public RedirectToActionResult RemoveFromSecondCart(int Id, string returnUrl) { SecondDishes secondDishes = mealRepository.SecondDishes .FirstOrDefault(p => p.Id == Id); if (secondDishes != null) { cart.RemoveLine(secondDishes); } return(RedirectToAction("Index", new { returnUrl })); }
public RedirectToActionResult AddToSecondCart(int Id, string returnUrl) { SecondDishes secondDishes = mealRepository.SecondDishes .FirstOrDefault(x => x.Id == Id); if (secondDishes != null) { cart.AddItem(secondDishes, 1); } return(RedirectToAction("Index", new { returnUrl })); }