diff --git a/API_SQLuedo/API/Program.cs b/API_SQLuedo/API/Program.cs index f4e19f8..a12b0d1 100644 --- a/API_SQLuedo/API/Program.cs +++ b/API_SQLuedo/API/Program.cs @@ -37,7 +37,14 @@ builder.Services.AddScoped, SuccessDataServiceApi>() builder.Services.AddScoped, LessonDataService>(); builder.Services.AddScoped, LessonDataServiceApi>(); -builder.Services.AddDbContext(); +builder.Services.AddDbContext(options => +{ + if (builder.Environment.IsProduction()) + { + throw new Exception("I am in production mode"); + } + throw new Exception("I am in development mode"); +}); builder.Services.AddDbContext(options => options.UseInMemoryDatabase("appDb")); builder.Services.AddIdentityApiEndpoints().AddEntityFrameworkStores();