From b2cf7ca89e5b6a18c9cdeedb110d49ecfbafc01a Mon Sep 17 00:00:00 2001 From: malik masis Date: Wed, 26 Oct 2022 10:40:39 +0300 Subject: [PATCH] Applied the temporary solution --- .../Pages/ProductDetail.cshtml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs index 32bcbdd0..f8dbf4f6 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/ProductDetail.cshtml.cs @@ -29,8 +29,17 @@ namespace EShopOnAbp.PublicWeb.Pages public async Task OnGet(Guid id) { - IsPurschased = (await _orderAppService.GetMyOrdersAsync(new GetMyOrdersInput())).Any(p => p.Items.Any(p => p.ProductId == id)); Product = await _productAppService.GetAsync(id); + + try + { + IsPurschased = (await _orderAppService.GetMyOrdersAsync(new GetMyOrdersInput())).Any(p => p.Items.Any(p => p.ProductId == id)); + } + catch (Exception e) + { + IsPurschased = false; + Console.WriteLine(e); + } } } } \ No newline at end of file