This commit is contained in:
2021-06-29 21:32:18 +00:00
parent 4d4611d2fa
commit 8c170eb9c3

View File

@@ -331,12 +331,21 @@ namespace AyaNova.Biz
#endif
var ret = await ct.TranslationItem.Where(z => z.TranslationId == UserTranslationId && param.Contains(z.Key)).AsNoTracking().ToDictionaryAsync(z => z.Key, z => z.Display);
#if (DEBUG)
if(ret.Count!=param.Count){
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<TranslationBiz>();
var missingItems = param.Where(p => ret.All(p2 => p2.Key != p));
if (ret.Count != param.Count)
{
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<TranslationBiz>();
log.LogError($"********* GetSubsetAsync Non existant keys requested: {string.Join( ",", missingItems)}");
var missingItems = param.Where(p => ret.All(p2 => p2.Key != p)).ToList();
var duplicateItems = param.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(y => y.Key)
.ToList();
if (missingItems.Count > 0)
log.LogError($"********* GetSubsetAsync problem: Non existant keys: {string.Join(",", missingItems)}");
if (duplicateItems.Count > 0)
log.LogError($"********* GetSubsetAsync problem: Duplicate keys: {string.Join(",", duplicateItems)}");
}