Merge branch 'dev' into feature/#13123485--import-fact-trajectories

This commit is contained in:
on.nemtina 2023-11-27 09:20:49 +05:00
commit 04b2fd4a0d

View File

@ -47,15 +47,6 @@ namespace AsbCloudInfrastructure
public static class DependencyInjection
{
public static IAsbCloudDbContext MakeContext(string connectionString)
{
var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
.UseNpgsql(connectionString)
.Options;
var context = new AsbCloudDbContext(options);
return context;
}
public static void MapsterSetup()
{
TypeAdapterConfig.GlobalSettings.Default.Config
@ -305,20 +296,6 @@ namespace AsbCloudInfrastructure
services.AddTransient<DetectedOperationExportService>();
return services;
}
public static IServiceCollection AddTransientLazy<TService, TImplementation>(this IServiceCollection services)
where TService : class
where TImplementation : class, TService
=> services.AddTransient<TService, TImplementation>()
.AddTransient(provider => new Lazy<TService>(provider.GetRequiredService<TService>));
public static IServiceCollection AddTransientLazy<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory)
where TService : class
where TImplementation : class, TService
=> services.AddTransient<TService, TImplementation>(implementationFactory)
.AddTransient(provider => new Lazy<TService>(() => implementationFactory(provider)));
}
}
}