Skip to content

0.3.0

Latest
Compare
Choose a tag to compare
@ben-foster-cko ben-foster-cko released this 08 May 14:58
· 1 commit to master since this release

This release includes support for asynchronous When predicates, for example:

await Pipeline.Build<TestContext>(cfg =>
    cfg
        .When(async ctx => await ValidateAccessAsync(ctx["id"]), builder =>
            builder.Add((ctx, next) =>
            {
                using (LogContext.PushProperty("id", ctx["id"]))
                {
                    return next.Invoke(ctx);
                }
            })
        )
        .Final(async (ctx) =>
        {
            await Execute(ctx);
            return ctx;
        })
)
.Invoke(new TestContext());

Thanks to @andreas-antoniou-cko for contributing this feature.