remove unused code

This commit is contained in:
ngfrolov 2023-11-24 08:50:00 +05:00
parent 9cc55ab458
commit 343825cb38
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -46,15 +46,6 @@ namespace AsbCloudInfrastructure
public static class DependencyInjection 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() public static void MapsterSetup()
{ {
TypeAdapterConfig.GlobalSettings.Default.Config TypeAdapterConfig.GlobalSettings.Default.Config
@ -301,19 +292,5 @@ namespace AsbCloudInfrastructure
return services; 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)));
} }
} }