using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using skydiveLogs_api.DomainService.Repositories; using skydiveLogs_api.Infrastructure; using skydiveLogs_api.DomainBusiness.Interfaces; using skydiveLogs_api.DomainBusiness; using skydiveLogs_api.Infrastructure.Interfaces; namespace skydiveLogs_api.Ioc { public class IocService { public IocService(IServiceCollection services, IConfiguration configuration) { _services = services; _configuration = configuration; } public void Configure() { _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); _services.AddScoped(); string connectionString = _configuration.GetConnectionString("DefaultConnection"); _services.AddSingleton(c => new LiteDbProvider(connectionString)); } private readonly IServiceCollection _services; private readonly IConfiguration _configuration; } }