feat: refactor week number handling to use WeekDefinitionId across multiple entities and queries
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using CMSMicroservice.Infrastructure.Persistence;
|
||||
using CMSMicroservice.Infrastructure.Data.Seeding;
|
||||
using CMSMicroservice.Application.Common.Interfaces;
|
||||
using CMSMicroservice.WebApi.Hubs;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -144,6 +145,11 @@ if (app.Environment.IsDevelopment())
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
var migrationSeeder = new NetworkParentIdMigrationSeeder(dbContext, migrationLogger);
|
||||
await migrationSeeder.SeedAsync();
|
||||
|
||||
// Seed WeekDefinitions (هفتهها)
|
||||
var weekSeederLogger = scope.ServiceProvider.GetRequiredService<ILogger<WeekDefinitionSeeder>>();
|
||||
var weekSeeder = new WeekDefinitionSeeder(dbContext, weekSeederLogger);
|
||||
await weekSeeder.SeedAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -152,6 +158,10 @@ else
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
// Load WeekDefinition cache (برای هر دو محیط Development و Production)
|
||||
var weekDefinitionRepository = app.Services.GetRequiredService<IWeekDefinitionRepository>();
|
||||
await weekDefinitionRepository.ReloadCacheAsync();
|
||||
|
||||
|
||||
app.UseRouting();
|
||||
app.UseCors("AllowAll");
|
||||
|
||||
Reference in New Issue
Block a user