fixed errors while logging raids

SQlite is now also used in production
This commit is contained in:
Sarah Faey 2022-11-24 17:56:06 +01:00
parent 7d6bc48dba
commit fc5e75cc9d
5 changed files with 12 additions and 20 deletions

View file

@ -9,14 +9,8 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
#if DEBUG
builder.Services.AddDbContextFactory<LiebContext>(opt =>
//opt.UseSqlServer(builder.Configuration.GetConnectionString("LiebContext")).EnableSensitiveDataLogging(), ServiceLifetime.Transient);
opt.UseSqlite(builder.Configuration.GetConnectionString("LiebContext")));
#else
builder.Services.AddDbContextFactory<LiebContext>(opt =>
opt.UseMySql(builder.Configuration.GetConnectionString("LiebContext"), ServerVersion.AutoDetect(builder.Configuration.GetConnectionString("LiebContext"))), ServiceLifetime.Transient);
#endif
builder.Services.AddDatabaseDeveloperPageExceptionFilter();