public IViewComponentResult Invoke(string view = "Default")
 {
     if (view == "Small")
     {
         var totalValue = _getCart.Action().Sum(x => x.Value * x.Qty);
         return(View(view, $"${totalValue}"));
     }
     return(View(view, _getCart.Action()));
 }
Esempio n. 2
0
        public IActionResult OnGet([FromServices] GetCart getCart)
        {
            CartList = getCart.Action();

            return(Page());
        }
Esempio n. 3
0
        public IActionResult GetCartMain([FromServices] GetCart getCart)
        {
            var cart = getCart.Action();

            return(PartialView("_CartPartial", cart));
        }
Esempio n. 4
0
        public IActionResult GetCartNav([FromServices] GetCart getCart)
        {
            var totalValue = getCart.Action().Sum(x => x.Value * x.Qty);

            return(PartialView("Components/Cart/Small", $"${totalValue}"));
        }