// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                using (var scope = app.ApplicationServices.CreateScope())
                {
                    RUSTWebApplicationContext context       = scope.ServiceProvider.GetService <RUSTWebApplicationContext>();
                    IDbInitializer            dbInitializer = scope.ServiceProvider.GetService <IDbInitializer>();
                    context.Database.EnsureDeleted();
                    context.Database.EnsureCreated();
                    dbInitializer.SeedInMemory(context);
                }
                app.UseDeveloperExceptionPage();
            }
            else
            {
                using (var scope = app.ApplicationServices.CreateScope())
                {
                    RUSTWebApplicationContext context       = scope.ServiceProvider.GetService <RUSTWebApplicationContext>();
                    IDbInitializer            dbInitializer = scope.ServiceProvider.GetService <IDbInitializer>();
                    context.Database.EnsureCreated();
                    //    dbInitializer.SeedAzure(context);
                }
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseCors("AllowSpecificOrigin");
            app.UseHttpsRedirection();
            app.UseAuthentication();
            app.UseMvc();
        }
 public UserRepository(RUSTWebApplicationContext context)
 {
     _context = context;
 }
 public ProductModelRepository(RUSTWebApplicationContext ctx)
 {
     _ctx = ctx;
 }
Beispiel #4
0
 public CountryRepository(RUSTWebApplicationContext ctx)
 {
     _ctx = ctx;
 }
 public OrderRepository(RUSTWebApplicationContext ctx)
 {
     _ctx = ctx;
 }
 public ProductCategoryRepository(RUSTWebApplicationContext ctx)
 {
     _ctx = ctx;
 }