public ActionResult add_to_cart(int id) { var UserName = User.Identity.GetUserName(); int qty = 1; var item = item_Service.GetItem(id); Cart_Item ct = new Cart_Item(); if (item != null) { cart_Service.UpdateQuantity(id, qty); //cart_Service.UpdateCart(item.ItemCode,item.Cart_Items.); cart_Service.AddItemToCart(id, UserName); return(RedirectToAction("AllItems")); } else { return(RedirectToAction("Not_Found", "Error")); } }