You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However in a modular system you might want different modules to be able to contribute named jobs to the system, just by adding them to the IServiceCollection. We don't want to have to couple those modules to this callback method, rather they just register services using IServiceCollection like everything else.
Consider a pattern like this:
// Module A
services.AddNamedSingleton<IJob,FooJob>("Foo");// Module B
services.AddNamedSingleton<IJob,BarJob>("Bar");// Then later before container is built
services.AddNamed<IJob>(names =>{// here, names will already contain the above two registrations that happened earlier so no need to add them again.// names.AddSingleton<FooJob>("Foo");// names.AddSingleton<BarJob>("Bar");});
The text was updated successfully, but these errors were encountered:
At the moment, to register named services, you have to configure them within a callback.
However in a modular system you might want different modules to be able to contribute named jobs to the system, just by adding them to the
IServiceCollection
. We don't want to have to couple those modules to this callback method, rather they just register services using IServiceCollection like everything else.Consider a pattern like this:
The text was updated successfully, but these errors were encountered: