public IActionResult OrderDetails() { var username = User.Identity.Name; if (username != null) { var orderId = _orderDetailsService.GetOrderId(username); var list = _orderDetailsService.GetOrderDetails(orderId); //viewbag = to pass the total in the html. ViewBag.total = _orderDetailsService.Subtotal(orderId, username); return(View(list)); } else { return(View()); } }