public JsonResult RemoveFromBasket(Guid productid, int quantity) { Dictionary <string, object> response = new Dictionary <string, object>(); var result = pRepository.Get(p => p.Id == productid); if (result.State == BusinessResultType.Success) { decimal total = 0; BasketHelper.Remove(result.Result, quantity); foreach (var item in BasketHelper.ProductsInBasket) { total += (item.Key.UnitPrice * item.Value); } response.Add("status", true); response.Add("message", ""); response.Add("total", total); } else { response.Add("status", false); response.Add("message", result.Message); } return(Json(response, JsonRequestBehavior.AllowGet)); }