public CityRepository(BcApiDbContext dbContext) : base(dbContext) { }
public ImageRepository(BcApiDbContext dbContext) : base(dbContext) { _context = dbContext; }
public MonthRepository(BcApiDbContext dbContext) : base(dbContext) { _context = dbContext; }
public CountryRepository(BcApiDbContext dbContext, IPropertyMappingService propertyMappingService) : base(dbContext) { _context = dbContext; _propertyMappingService = propertyMappingService; }
public ProvienceRepository(BcApiDbContext dbContext) : base(dbContext) { _context = dbContext; }
public EntityRepository(BcApiDbContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, BcApiDbContext context) { loggerFactory.AddDebug(LogLevel.Information); loggerFactory.AddConsole(); loggerFactory.AddNLog(); app.UseStatusCodePages(); if (env.IsDevelopment()) { //app.UseDeveloperExceptionPage(); // Add MVC to the request pipeline. app.UseCors(builder => builder.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod()); app.UseExceptionHandler(appBuilder => { appBuilder.Run(async cont => { cont.Response.Headers.Add("Access-Control-Allow-Origin", "*"); //cont.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS"); //cont.Response.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept"); var exceptionHandlerFeature = cont.Features.Get <IExceptionHandlerFeature>(); if (exceptionHandlerFeature != null) { var logger = loggerFactory.CreateLogger("Global exception logger"); logger.LogError(500, exceptionHandlerFeature.Error, exceptionHandlerFeature.Error.Message); } cont.Response.StatusCode = 500; await cont.Response.WriteAsync("An unexpected fault happened. Try again later."); }); }); } else { app.UseExceptionHandler(appBuilder => { appBuilder.Run(async cont => { var exceptionHandlerFeature = cont.Features.Get <IExceptionHandlerFeature>(); if (exceptionHandlerFeature != null) { var logger = loggerFactory.CreateLogger("Global exception logger"); logger.LogError(500, exceptionHandlerFeature.Error, exceptionHandlerFeature.Error.Message); } cont.Response.StatusCode = 500; await cont.Response.WriteAsync("An unexpected fault happened. Try again later."); }); }); } //app.UseResponseCaching(); //app.UseHttpCacheHeaders(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); app.UseMvc(); // DbInitializer.Initialize(context); }
public AttractionRepository(BcApiDbContext dbContext) : base(dbContext) { _context = dbContext; }