Aggiunto modello e migrations x MtcSetup
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using MP.Data.Repository.Mtc;
|
||||
using MP.Data.Repository.Utils;
|
||||
using MP.Data.Services.Mtc;
|
||||
using MP.Data.Services.Utils;
|
||||
|
||||
namespace MP.Data
|
||||
{
|
||||
public static class DataServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddIocSetup(this IServiceCollection services)
|
||||
{
|
||||
//// DbContextFactory: preferibile in Blazor Server e scenari concorrenti
|
||||
//services.AddDbContextFactory<DataLayerContext>(options =>
|
||||
// options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
|
||||
//// servizi preliminari
|
||||
////services.TryAddSingleton<IConnectionMultiplexer>(redisConn);
|
||||
//services.TryAddSingleton<IRedisService, RedisService>();
|
||||
//services.TryAddSingleton<IRedisSubscriptionManager, RedisSubscriptionManager>();
|
||||
|
||||
// Repository Scoped
|
||||
services.TryAddScoped<IMtcSetupRepository, MtcSetupRepository>();
|
||||
services.TryAddScoped<IStatsAggrRepository, StatsAggrRepository>();
|
||||
services.TryAddScoped<IStatsDetailRepository, StatsDetailRepository>();
|
||||
|
||||
// Servizi Scoped
|
||||
services.TryAddScoped<IMtcSetupService, MtcSetupService>();
|
||||
services.TryAddScoped<IStatsAggrService, StatsAggrService>();
|
||||
services.TryAddScoped<IStatsDetailService, StatsDetailService>();
|
||||
|
||||
//// aggiunta servizi finali Singleton...
|
||||
//services.TryAddSingleton<IImageCacheService, ImageCacheService>();
|
||||
//services.TryAddSingleton<IConfigDataService, ConfigDataService>();
|
||||
//services.TryAddSingleton<ICalcRequestService, CalcRequestService>();
|
||||
//services.TryAddSingleton<IFileService, FileService>();
|
||||
//services.TryAddSingleton<IProdService, ProdService>();
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user