Inizio setup repository
This commit is contained in:
+23
-6
@@ -1,9 +1,10 @@
|
||||
using Microsoft.AspNetCore.Authentication.Negotiate;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using MP.AppAuth.Services;
|
||||
using MP.Data.Services;
|
||||
using MP.Data;
|
||||
using MP.SPEC.Components;
|
||||
using MP.SPEC.Data;
|
||||
using MP.SPEC.Services;
|
||||
@@ -155,20 +156,36 @@ builder.Services.AddFusionCache()
|
||||
ConnectionMultiplexerFactory = () => Task.FromResult(redisMultiplexer)
|
||||
}));
|
||||
|
||||
// Metodi principali x accesso dati
|
||||
var connStr = builder.Configuration.GetConnectionString("MP.Data")
|
||||
?? throw new InvalidOperationException("ConnString 'MP.Data' mancante.");
|
||||
// aggiungo il costruttore x i DbContextFactory
|
||||
builder.Services.AddDbContextFactory<MoonProContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
|
||||
// MP.Data Services Utils - Statistiche DB
|
||||
builder.Services.AddSpecDataLayer();
|
||||
|
||||
// altri servizi
|
||||
builder.Services.AddSingleton<MpDataService>();
|
||||
builder.Services.AddSingleton<ListSelectDataSrv>();
|
||||
builder.Services.AddSingleton<IOApiService>();
|
||||
builder.Services.AddSingleton<AppAuthService>();
|
||||
builder.Services.AddScoped<MsgServiceSpec>();
|
||||
|
||||
#if false
|
||||
builder.Services.AddSingleton<AppAuthService>();
|
||||
builder.Services.AddSingleton<ListSelectDataSrv>();
|
||||
builder.Services.AddSingleton<SharedMemService>();
|
||||
builder.Services.AddSingleton<TabDataService>();
|
||||
builder.Services.AddSingleton<TabDataFeeder>();
|
||||
builder.Services.AddSingleton<TabDataFeeder>();
|
||||
#endif
|
||||
|
||||
#if false
|
||||
// aggiunta helper local/session storage service
|
||||
builder.Services.AddScoped<ISessionStorageService, SessionStorageService>();
|
||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
#endif
|
||||
|
||||
|
||||
builder.Services.AddHttpClient();
|
||||
|
||||
Reference in New Issue
Block a user