Update metodi async con FusionCache
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user