|
|
@ -37,7 +37,14 @@ builder.Services.AddScoped<ISuccessService<SuccessDto>, SuccessDataServiceApi>()
|
|
|
|
builder.Services.AddScoped<ILessonService<LessonEntity>, LessonDataService>();
|
|
|
|
builder.Services.AddScoped<ILessonService<LessonEntity>, LessonDataService>();
|
|
|
|
builder.Services.AddScoped<ILessonService<LessonDto>, LessonDataServiceApi>();
|
|
|
|
builder.Services.AddScoped<ILessonService<LessonDto>, LessonDataServiceApi>();
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddDbContext<DbContext, UserDbContext>();
|
|
|
|
builder.Services.AddDbContext<UserDbContext>(options =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (builder.Environment.IsProduction())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Exception("I am in production mode");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new Exception("I am in development mode");
|
|
|
|
|
|
|
|
});
|
|
|
|
builder.Services.AddDbContext<WebAPIDbContext>(options => options.UseInMemoryDatabase("appDb"));
|
|
|
|
builder.Services.AddDbContext<WebAPIDbContext>(options => options.UseInMemoryDatabase("appDb"));
|
|
|
|
builder.Services.AddIdentityApiEndpoints<IdentityUser>().AddEntityFrameworkStores<WebAPIDbContext>();
|
|
|
|
builder.Services.AddIdentityApiEndpoints<IdentityUser>().AddEntityFrameworkStores<WebAPIDbContext>();
|
|
|
|
|
|
|
|
|
|
|
|