Refactored and fixed errors

This commit is contained in:
2024-08-15 23:42:18 +03:00
parent 72924fb037
commit 026a104131
21 changed files with 165 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
using ApplicationLayer.Applicants;
using ApplicationLayer.Locations;
using ApplicationLayer.VisaApplications;
using ApplicationLayer.Applicants.NeededServices;
using ApplicationLayer.Locations.NeededServices;
using ApplicationLayer.VisaApplications.NeededServices;
using Infrastructure.Database;
using Infrastructure.Database.Applicants.Repositories;
using Infrastructure.Database.Generic;
@@ -20,7 +20,7 @@ public static class DependencyInjection
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
{
//TODO строка подключения
services.AddDbContext<DbContext>(opts =>
services.AddDbContextFactory<DbContext>(opts =>
opts.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=visadb;Integrated Security=True;"));
services.AddScoped<IGenericReader>(serviceProvider => serviceProvider.GetRequiredService<DbContext>());
@@ -34,4 +34,4 @@ public static class DependencyInjection
return services;
}
}
}