I\'ve found this answer but it doesn\'t seem to fit in my ASP Net Core project.
Things I am trying to understand:
Adding to Temi's answer and Xavier's comment to it, my experience with this was a little different using asp.net-core-2.
In order to get this working I had to add the IServiceProvider
as a parameter of the Configure
method to get an instance of it.
public void Configure(
IApplicationBuilder App,
IHostingEnvironment Env,
ILoggerFactory LoggerFactory,
IServiceProvider ServiceProvider
)
{
/* trimmed */
CreateRoles(ServiceProvider).Wait();
}