Skip to content

Enable Scrutor to use external DI #98

@pfeigl

Description

@pfeigl

We had DI running for quite some time now using the standard microsoft implementation. Due to several reasons (one beeing dotnet/aspnetcore#2737) we now move to SimpleInjector (which we used on legacy WebApi projects alot).

Now SimpleInjector does not have rich assembly scanning support and states

Although many other DI libraries contain an advanced API for doing convention based registration, we found that doing this with custom LINQ queries is easier to write, more understandable, and can often prove to be more flexible than using a predefined and restrictive API.

I can totally accept this, however we are now sitting infront of quite some Scrutor lines which did this heavy lifting for us.

Something that would now have been really cool is to still be able to use Scrutor but inject a custom RegistrationStrategy which under the hood would not do services.Add but instead a custom action like container.Register. (SimpleInjector even has some code under the hood which turns ServiceDescriptor objects into SImpleInjector registrations).

Does this make any sense or is it completely out of the scope of this project?

Thanks,
Philipp

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