public static void Main(string[] args) { IWebHost host = CreateWebHostBuilder(args).Build(); using (IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; try { AuthorizationDBContext context = services.GetRequiredService <AuthorizationDBContext>(); context.Database.EnsureCreated(); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database."); } } host.Run(); }
public EndUserRepository(AuthorizationDBContext authorizationDBContext) { this.authorizationDBContext = authorizationDBContext ?? throw new ArgumentNullException(nameof(authorizationDBContext)); }
public UserDAL(AuthorizationDBContext authorizationDBContext) { _authorizationDBContext = authorizationDBContext; }