public async Task <IActionResult> OnPostAddToCompareAsync(int productId) { if (!User.Identity.IsAuthenticated) { return(RedirectToPage("./Account/Login", new { area = "Identity" })); } await _productPageService.AddToCompare(User.Identity.Name, productId); return(RedirectToPage()); }