Update metodi async con FusionCache

This commit is contained in:
Samuele Locatelli
2026-05-27 19:45:29 +02:00
parent 47a952c204
commit 44c19a2c5f
4 changed files with 70 additions and 61 deletions
+7 -9
View File
@@ -2531,17 +2531,15 @@ namespace MP.Data.Controllers
/// <param name="KitCode"></param>
/// <param name="codChild"></param>
/// <returns></returns>
public List<TemplateKitModel> TemplateKitFilt(string KitCode, string codChild)
public async Task<List<TemplateKitModel>> TemplateKitFiltAsync(string KitCode, string codChild)
{
List<TemplateKitModel> dbResult = new List<TemplateKitModel>();
using (var dbCtx = new MoonProContext(options))
{
dbResult = dbCtx
.DbSetTempKit
.Where(x => (string.IsNullOrEmpty(KitCode) && string.IsNullOrEmpty(codChild)) || (x.CodArtParent.Contains(KitCode) && !string.IsNullOrEmpty(KitCode)) || (x.CodArtChild.Contains(codChild) && !string.IsNullOrEmpty(codChild)))
.AsNoTracking()
.ToList();
}
using var dbCtx = new MoonProContext(options);
dbResult = await dbCtx
.DbSetTempKit
.Where(x => (string.IsNullOrEmpty(KitCode) && string.IsNullOrEmpty(codChild)) || (x.CodArtParent.Contains(KitCode) && !string.IsNullOrEmpty(KitCode)) || (x.CodArtChild.Contains(codChild) && !string.IsNullOrEmpty(codChild)))
.AsNoTracking()
.ToListAsync();
return dbResult;
}
+1 -1
View File
@@ -3498,7 +3498,7 @@ namespace MP.Data.Services
result = new List<TemplateKitModel>();
}
sw.Stop();
Log.Debug($"TemplateKitFilt | {source} | {sw.Elapsed.TotalMilliseconds}ms");
Log.Debug($"TemplateKitFiltAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}