-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Consider a registration experience like this:
builder.Services.DiscoverAndRegisterModules(c =>
{
c.SolutionName = "eShop2";
c.AutoDiscover = false;
c.RegisterModulesFromAssemblies(typeof(IUserService).Assembly); // blatantly _borrowed_ from MediatR
c.RegisterModulesFromAssemblyContaining<IPaymentService>();
c.SetConfiguration(builder.Configuration);
c.SetLogger(myConsoleLogger);
// .... OR
c.AutoDiscover = true; // default
c.RegisterModulesFromAssemblyContaining<MyDataContract>();
});Lots of packages use this configuration style to handle setup.
If nothing is passed, it would use sensible defaults, but it gives the user to option to override certain behavior of the registration process.
While also avoiding having to keep passing in potentially more and more optional parameters as the feature set grows.
Examples of features would be:
- Allowing users to skip auto discovery (for those that are concerned about performance)
- Setting the IConfiguration and Logger (so that it doesn't have to pre-build the service builder
- Altering module names to exclude/ignore
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request