public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env) { Environment = env.EnvironmentName; CashbackStartup.Configure(Configuration.GetConnectionString("CashbackDb")); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Cashback API.v1"); c.RoutePrefix = string.Empty; }); // Enabling Cross-Origin Requests app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseHttpsRedirection(); app.UseMvc(); }
public Empty_DbContextFixture() { var builder1 = new DbContextOptionsBuilder <CashbackDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .EnableSensitiveDataLogging() .ConfigureWarnings(warnings => warnings .Throw(CoreEventId.IncludeIgnoredWarning) .Throw(RelationalEventId.QueryClientEvaluationWarning)); DbContext = new CashbackDbContext(builder1.Options); CommandsHandler = new CashbackCommandsHandler(DbContext); CashbackStartup.Configure(null); }