public static void Main(string[] args)
        {
            var host = BuildWebHost(args);

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;
                try
                {
                    var context     = services.GetRequiredService <AppIdentitiyDbContext>();
                    var userManager = services.GetRequiredService <UserManager <AppIdentityUser> >();

                    var task = AppIdentitiyDbContext.Initialize(context, userManager);
                    task.Wait();
                }
                catch (Exception ex)
                {
                    var logger = services.GetRequiredService <ILogger <Program> >();
                    logger.LogError(ex, "An error occurred while seeding the database.");
                }
            }

            host.Run();
        }
 public ValuesController(AppIdentitiyDbContext context)
 {
     this.context = context;
 }