Aggiunta hashset x velocizzare ricerca recipes x PODL

This commit is contained in:
Samuele Locatelli
2026-05-26 16:37:54 +02:00
parent 8461398ff8
commit 40694e5766
12 changed files with 174 additions and 63 deletions
+43
View File
@@ -1615,6 +1615,49 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco da tabella Macchine filtro x gruppo
/// </summary>
/// <param name="codGruppo"></param>
/// <returns></returns>
public async Task<List<MacchineModel>> MacchineGetFiltAsync(string codGruppo)
{
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(options))
{
if (codGruppo == "*")
{
dbResult = await dbCtx
.DbSetMacchine
.AsNoTracking()
.OrderBy(x => x.IdxMacchina)
.ToListAsync();
}
else
{
dbResult = await dbCtx
.DbSetGrp2Macc
.Where(g => g.CodGruppo == codGruppo)
.Join(dbCtx.DbSetMacchine,
g => g.IdxMacchina,
m => m.IdxMacchina,
(g, m) => m
)
.AsNoTracking()
.OrderBy(x => x.IdxMacchina)
.ToListAsync();
}
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in MacchineGetFiltAsync{Environment.NewLine}{exc}");
}
return dbResult;
}
/// <summary>
/// Elenco id MacchineModel che abbiano dati FLuxLog, nel periodo indicato
/// </summary>