Aggiunta metodi gestione cache conf

This commit is contained in:
Samuele Locatelli
2023-10-03 12:17:14 +02:00
parent bc432f994f
commit 35767c2716
4 changed files with 106 additions and 49 deletions
+23 -6
View File
@@ -5,7 +5,6 @@ using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Data.Controllers
{
@@ -23,11 +22,6 @@ namespace MP.Data.Controllers
#region Public Methods
public void Dispose()
{
_configuration = null;
}
/// <summary>
/// Restituisce l'anagrafica eventi per intero
/// </summary>
@@ -45,6 +39,29 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco da tabella Config
/// </summary>
/// <returns></returns>
public List<ConfigModel> ConfigGetAll()
{
List<ConfigModel> dbResult = new List<ConfigModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetConfig
.AsNoTracking()
.OrderBy(x => x.Chiave)
.ToList();
}
return dbResult;
}
public void Dispose()
{
_configuration = null;
}
#endregion Public Methods
#region Private Fields