Completato fix SPEC, ok x MON, altri da verificare/sistemare
This commit is contained in:
+10
-5
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using MP.Data;
|
||||
using MP.SPEC.Components;
|
||||
@@ -159,19 +160,23 @@ builder.Services.AddFusionCache()
|
||||
// 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
|
||||
// aggiungo il costruttore x i vari DbContextFactory
|
||||
builder.Services.AddDbContextFactory<MoonProContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
builder.Services.AddDbContextFactory<MoonPro_VocContext>(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<IOApiService>();
|
||||
builder.Services.AddScoped<MsgServiceSpec>();
|
||||
// servizi del progetto SPEC
|
||||
builder.Services.TryAddScoped<MpDataService>();
|
||||
builder.Services.TryAddSingleton<IOApiService>();
|
||||
builder.Services.TryAddScoped<MsgServiceSpec>();
|
||||
|
||||
#if false
|
||||
builder.Services.AddSingleton<AppAuthService>();
|
||||
|
||||
Reference in New Issue
Block a user