// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public virtual void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IOptions <SwaggerAppOptions> swaggerOptions, IConfiguration configuration, ServicePSDbContext dbContext) { app.UseStaticFiles(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.DocumentTitle = swaggerOptions.Value.Title; c.RoutePrefix = string.Empty; c.SwaggerEndpoint($"{swaggerOptions.Value.Endpoint}", swaggerOptions.Value.Title); }); app.UseHttpsRedirection(); app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); app.UseMvc(); }
/// <summary> /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline /// </summary> /// <param name="app">App</param> /// <param name="env">Env</param> /// <param name="loggerFactory">Logger</param> /// <param name="swaggerOptions">Swagger Option</param> /// <param name="configuration">Configuration</param> public override void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IOptions <SwaggerAppOptions> swaggerOptions, IConfiguration configuration, ServicePSDbContext dbContext) { app.UseMvc(); dbContext.Database.OpenConnection(); dbContext.Database.EnsureCreated(); }
public AppSettingRepository(ServicePSDbContext context) : base(context) { }