Skip to content

Dependency Injection

Marty Mathis edited this page Aug 27, 2020 · 11 revisions

Pipeline Framework now supports Microsoft Dependency Injection through an extensions package, PipelineFramework.Extensions.Microsoft.DependencyInjection.

nuget

Example usage:

    var services = new ServiceCollection();

    services
        .AddPipelineFramework()
        .AddAsyncPipeline<ExamplePipelinePayload, ExecutionStatusReceiver>(
            cfg => cfg
                .WithComponent<FooComponent>()
                .WithComponent<DelayComponent>()
                .WithComponent<BarComponent>(),
            settings);

    var provider = services.BuildServiceProvider();
    var pipeline = provider.GetService<IAsyncPipeline<ExamplePipelinePayload>>();

Previous versions of Pipeline Framework supported a few popular DI containers. If you are interested in potentially using this, check out the repository here.

Clone this wiki locally