forked from ddrilling/AsbCloudServer
remove unused code
This commit is contained in:
parent
9cc55ab458
commit
343825cb38
@ -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
|
||||||
@ -300,20 +291,6 @@ namespace AsbCloudInfrastructure
|
|||||||
services.AddTransient<DetectedOperationExportService>();
|
services.AddTransient<DetectedOperationExportService>();
|
||||||
|
|
||||||
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)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user