/// <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> public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserSettingContext context) { // add NLog to ASP.NET Core if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers().RequireAuthorization(); }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "UserSettings API v1"); }); }
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserSettingContext context) { base.Configure(app, env, context); context.Database.EnsureDeleted(); context.Database.EnsureCreated(); }
public UserSettingRepository(UserSettingContext context) { _context = context; }