This commit is contained in:
2023-04-21 19:34:11 +00:00
parent a296bc9b4f
commit 8f2ab38ba2
3 changed files with 24 additions and 4 deletions

View File

@@ -312,9 +312,15 @@ namespace Sockeye.Biz
{
if (!vc.Has("productname", item.ProductId))
{
vc.Add(await ct.Product.AsNoTracking().Where(x => x.Id == item.ProductId).Select(x => x.Name).FirstOrDefaultAsync(), "productname", item.ProductId);
var productInfo = await ct.Product.AsNoTracking().Where(x => x.Id == item.ProductId).FirstOrDefaultAsync();
vc.Add(productInfo.Name, "productname", item.ProductId);
vc.Add(productInfo.InitialPrice.ToString(), "productinitialprice", item.ProductId);
vc.Add(productInfo.RenewPrice.ToString(), "productrenewprice", item.ProductId);
}
item.ProductViz = vc.Get("productname", item.ProductId);
item.RenewPriceViz = vc.GetAsDecimal("productrenewprice", item.ProductId) ?? 0;
item.InitialPriceViz = vc.GetAsDecimal("productinitialprice", item.ProductId) ?? 0;
}
}