Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, LvMiniDbContext lvMiniDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler(appBuilder =>
                {
                    appBuilder.Run(async context =>
                    {
                        context.Response.StatusCode = 500;
                        await context.Response.WriteAsync("An unexpected fault happened. Please try again later.");
                    });
                });
            }

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "LvMiniAPI 1.0");
            });
            app.UseAuthentication();
            app.UseMvc();
        }
Пример #2
0
 public TeamRepository(LvMiniDbContext context)
     : base(context)
 {
 }
Пример #3
0
 public ProductGroupRepository(LvMiniDbContext context) : base(context)
 {
 }
Пример #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ConfigurationDbContext configurationDbContext, PersistedGrantDbContext persistedGrantDbContext, LvMiniDbContext lvMiniDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            configurationDbContext.Database.Migrate();
            configurationDbContext.SeedDataForContext();

            persistedGrantDbContext.Database.Migrate();

            lvMiniDbContext.SeedUsersForContext();

            FileExtensionContentTypeProvider typeProvider = new FileExtensionContentTypeProvider();

            if (!typeProvider.Mappings.ContainsKey(".woff2"))
            {
                typeProvider.Mappings.Add(".woff2", "application/font-woff2");
            }
            app.UseIdentityServer();
            app.UseStaticFiles();
            app.UseMvcWithDefaultRoute();
        }
Пример #5
0
 public LogRepository(LvMiniDbContext context) : base(context)
 {
 }
Пример #6
0
 protected BaseRepository(LvMiniDbContext context)
 {
     Context  = context;
     Entities = Context.Set <T>();
 }
Пример #7
0
 public UserRepository(LvMiniDbContext context)
     : base(context)
 {
 }