Closed romanolester closed 5 years ago
I am really new to ASP.NET Core so please bear with me 😁
I am really new to ASP.NET Core so please bear with me 😁
No problem, even better! Means besides contributing to a project, you learn some new tech 🙂
Now in the Program.cs
maybe because I inherited IAsyncInitializer interface?
According to the this, you don't need to do it that way, just change the Main to something similar to:
public static async Task Main(string[] args)
{
var host = CreateWebHostBuilder(args).Build();
await host.InitAsync();
host.Run();
}
The extension will do its thing, and grab the dependencies you registered in the Startup
class to init everything.
oops sorry. my bad
lastly
how should i properly register the initializer?
That should be correct.
I think it's the generic constraints that are not well defined in the DbInitializer
.
Should probably be like this:
public class DbInitiliazer<T> : IAsyncInitializer where T : DbContext
That did it. Thank you.
resolving issue #19