Skip to content

Use Dazinator.Extensions.DependencyInjection.ChildContainers #75

Description

@dazinator

Autofac and Structuremap are "non native" DI containers.

I now have a solution to create child containers using the native Microsoft ServiceProvider: https://github.com/dazinator/Dazinator.Extensions.DependencyInjection/blob/develop/src/DependencyInjection.ChildContainers/README.md

I'll need to make this the "default" approach used, and possibly deprecate autofac and structuremap until they can be added back in future (if its too much work to tackle at this stage)

This will help solve a number of issues a bugs like #74

I was also never truly happy with the resolution of #38 because it involved creating a temporary "copy" of services that needed to be present in the child IServiceCollection when building the child container otherwise AddXyz() calls that look for those services and sometimes grab instances, could fail. The new approach solves that thanks to ChildServiceCollection: https://github.com/dazinator/Dazinator.Extensions.DependencyInjection/blob/develop/src/DependencyInjection.Tests/ChildServiceProvider/ChildServiceCollectionTests.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions