public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } try { await _productPageService.UpdateProduct(Product); } catch (DbUpdateConcurrencyException) { if (!ProductExists(Product.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }