public void AddtoCart(string id, int quantity)
 {
     try {
         var dto   = _service.ProductByID(id);
         var value = HttpContext.Session.GetString("CartId");
         _shoppingCart.AddtoCart(dto, quantity, value);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 public async Task <ActionResult <ProductDto> > Get(string id)
 {
     try
     {
         var dto = _service.ProductByID(id);
         return(await Task.FromResult(dto));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 3
0
        public ActionResult ProductDetails(string id)
        {
            var dto = _service.ProductByID(id);

            return(PartialView("_ProductDetails", dto));
        }