public async Task <IActionResult> OnPostAddToCartAsync([FromQuery] string bookedDateId) { var bookedDate = await bookingService.GetBookedDate(bookedDateId); if (bookedDate == null) { this.ErrorPage(); } var bookingCartItem = HttpContext.IsAuthenticated() ? await userBookingCart.AddToCart(bookedDate) : await sessionBookingCart.AddToCart(bookedDate); return(bookingCartItem != null ? (IActionResult)RedirectToPage("/Cart", new { area = "Cart" }) : this.ErrorPage()); }