public async Task <ActionResult> Checkout() { var list2 = JsonConvert.DeserializeObject <List <CartModel> >(TempData["cart"] as string); //var list2 = ViewData["cart"] as List<CartModel>; var model = new InvoiceModel(); var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = await _userManager.FindByIdAsync(userId); TempData["user"] = JsonConvert.SerializeObject(user); return(View(model.GenerateInvoice(user, list2))); }