Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Program
- {
- public static void Main(string[] args)
- {
- var host = BuildWebHost(args);
- // RunSeedMethods(host);
- host.Run();
- }
- public static IWebHost BuildWebHost(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- .UseApplicationInsights()
- .UseStartup<Startup>()
- .Build();
- // ReSharper disable once UnusedMember.Local
- private static void RunSeedMethods(IWebHost host)
- {
- using (var scope = host.Services.CreateScope())
- {
- var services = scope.ServiceProvider;
- try
- {
- var userManager = services.GetRequiredService<UserManager<ApplicationUser>>();
- var roleManager = services.GetRequiredService<RoleManager<ApplicationRole>>();
- // DatabaseIdentityInitializer.Init(userManager, roleManager).Wait();
- DatabaseIdentityInitializer.CreateDeveloperAccount(userManager, roleManager).Wait();
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- throw;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment