From d4cfe83a9e29e5d927094d44e72e19f4ba8932cc Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 24 Mar 2026 08:30:59 +0100 Subject: [PATCH] ancora fix selezione metodo --- .../DataServiceCollectionExtensions.cs | 3 +- .../EgwCoreLib.Lux.Data.csproj | 1 - .../Services/General/ConfigDataService.cs | 11 +---- .../Services/General/IConfigDataService.cs | 47 +++++++++++++++++++ Lux.API/Program.cs | 1 - Lux.UI/Program.cs | 1 - 6 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 EgwCoreLib.Lux.Data/Services/General/IConfigDataService.cs diff --git a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs index f9e5be71..da37c9b0 100644 --- a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs +++ b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs @@ -100,8 +100,9 @@ namespace EgwCoreLib.Lux.Data //services.TryAddScoped(); // aggiunta servizi finali Singleton... + services.TryAddSingleton(); + services.TryAddSingleton(); //services.TryAddSingleton(); - services.AddSingleton(); return services; diff --git a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj index 860c7ff1..fed9128f 100644 --- a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj +++ b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj @@ -54,7 +54,6 @@ - diff --git a/EgwCoreLib.Lux.Data/Services/General/ConfigDataService.cs b/EgwCoreLib.Lux.Data/Services/General/ConfigDataService.cs index ca5b34ee..5dd70aae 100644 --- a/EgwCoreLib.Lux.Data/Services/General/ConfigDataService.cs +++ b/EgwCoreLib.Lux.Data/Services/General/ConfigDataService.cs @@ -1,21 +1,14 @@ using Egw.Window.Data; -using EgwCoreLib.Lux.Core.RestPayload; -using EgwCoreLib.Lux.Data.Controllers; using EgwCoreLib.Lux.Data.DbModel.Config; using EgwMultiEngineManager.Data; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using NLog; using StackExchange.Redis; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace EgwCoreLib.Lux.Data.Services +namespace EgwCoreLib.Lux.Data.Services.General { - public class ConfigDataService : BaseServ + public class ConfigDataService : BaseServ, IConfigDataService { #region Public Constructors diff --git a/EgwCoreLib.Lux.Data/Services/General/IConfigDataService.cs b/EgwCoreLib.Lux.Data/Services/General/IConfigDataService.cs new file mode 100644 index 00000000..d9fdde9f --- /dev/null +++ b/EgwCoreLib.Lux.Data/Services/General/IConfigDataService.cs @@ -0,0 +1,47 @@ +using Egw.Window.Data; +using EgwCoreLib.Lux.Data.DbModel.Config; +using EgwMultiEngineManager.Data; + +namespace EgwCoreLib.Lux.Data.Services.General +{ + /// + /// Interfaccia servizio dati configurazione + /// + public interface IConfigDataService + { + #region Public Methods + + /// + /// Restituisce l'elenco dell'HW valido da cache REDIS + /// + /// Environment di esecuzione + /// Richiesta hardware (default: HW.AGB) + /// Elenco di modelli hardware + List HwModelList(Constants.EXECENVIRONMENTS execEnvironment, string HwReq = "HW.AGB"); + + /// + /// Restituisce l'elenco dei profili da cache REDIS + /// + /// Environment di esecuzione + /// Richiesta profilo (default: Default) + /// Elenco di nomi profili + List ProfileList(Constants.EXECENVIRONMENTS execEnvironment, string ProfReq = "Default"); + + /// + /// Restituisce l'elenco delle soglie dei profili da cache REDIS + /// + /// Environment di esecuzione + /// Richiesta profilo (default: Default) + /// Elenco di nomi profili con soglie + List ProfileThreshList(Constants.EXECENVIRONMENTS execEnvironment, string ProfReq = "Default"); + + /// + /// Restituisce il dizionario dei profili + relativa lista soglie da cache REDIS + /// + /// Environment di esecuzione + /// Dizionario profili -> liste di soglie + Dictionary> ProfileThreshDict(Constants.EXECENVIRONMENTS execEnvironment); + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/Lux.API/Program.cs b/Lux.API/Program.cs index be41340b..1bc19996 100644 --- a/Lux.API/Program.cs +++ b/Lux.API/Program.cs @@ -157,7 +157,6 @@ builder.Services.AddDbContextFactory(options => builder.Services.AddLuxData(connectionString); // servizi Singleton (no DB) -builder.Services.AddSingleton(); builder.Services.AddSingleton(); // servizi con dipendenze" ma Scoped diff --git a/Lux.UI/Program.cs b/Lux.UI/Program.cs index 940ef088..ce01fed2 100644 --- a/Lux.UI/Program.cs +++ b/Lux.UI/Program.cs @@ -187,7 +187,6 @@ builder.Services.AddSingleton, IdentityNoOpEmailSe // Aggiunta servizi specifici builder.Services.AddSingleton(); builder.Services.AddSingleton(); -builder.Services.AddSingleton(); builder.Services.AddSingleton(); // aggiunta componenti Radzen