AspNetCoreFromZeroToOverkill / GroupManagement

MIT License
29 stars 15 forks source link

Create some ServiceCollection extensions to make it easier to register the initializer in DI #20

Closed joaofbantunes closed 5 years ago

romanolester commented 5 years ago

Can you please elaborate? 😁

joaofbantunes commented 5 years ago

Maybe this isn't really needed, but we can do it just for the fun of it 😛. The idea is to create an extension method on the new StartupTasks project, to register the DbInitializer task in the DI container. So instead of what we have now in the Startup class:

services.AddAsyncInitializer<DbInitializer<GroupManagementDbContext>>();

We would have something like:

services.AddDbInitializer<GroupManagementDbContext>();

Like I said, not particularly important, but it's a bit more obvious, hiding a bit the AsyncInitialization, which isn't really important to be explicit.

romanolester commented 5 years ago

but hey. The title of the project is ASP.NET Core: From 0 to overkill. So this must be done 😁. please assign me to this issue.

joaofbantunes commented 5 years ago

Indeed 😛