Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public EndUserRepository(AuthorizationDBContext authorizationDBContext)
 {
     this.authorizationDBContext = authorizationDBContext ?? throw new ArgumentNullException(nameof(authorizationDBContext));
 }
Ejemplo n.º 3
0
 public UserDAL(AuthorizationDBContext authorizationDBContext)
 {
     _authorizationDBContext = authorizationDBContext;
 }