using Infrastructure.Database; using Infrastructure.Database.Applicants.Repositories; using Infrastructure.Database.Generic; using Infrastructure.Database.Locations.Repositories.Cities; using Infrastructure.Database.Locations.Repositories.Countries; using Infrastructure.Database.VisaApplications.Repositories; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using DbContext = Infrastructure.Database.DbContext; namespace Infrastructure { public static class DependencyInjection { public static IServiceCollection AddInfrastructure(this IServiceCollection services) { //TODO строка подключения services.AddDbContext(opts => opts.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=visadb;Integrated Security=True;")); services.AddScoped(serviceProvider => serviceProvider.GetRequiredService()); services.AddScoped(serviceProvider => serviceProvider.GetRequiredService()); services.AddScoped(serviceProvider => serviceProvider.GetRequiredService()); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); return services; } } }