-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register services with ImplementationFactory #211
Comments
Hello @LeonxPRO! 👋🏻 The issue with providing a factory like that is that it needs to work for all subtypes of I'd love to know a bit more about what you're trying to do. Do you have a concrete example? |
Sample is pretty straighforward, just have a bunch of classes that have the same interface for wich you want to have a property filled during creation. .WithSingletonLifetime(Func<IServiceProvider, TService> implementationFactory)) would be awesome :) |
Hello!
First, thanks for a Scrutor)
Is it any way for register services with ImplementationFactory, like in native
IServiceCollection
method ?AddSingleton<TService>(Func<IServiceProvider, TService> implementationFactory)
I imagine that like:
instead
WithSingletonLifetime()
The text was updated successfully, but these errors were encountered: