public ActionResult Delete(int id, string confirmButton) { var album = _repo.Albums .Single(a => a.AlbumId == id); _repo.Delete(album); return(View("Deleted")); }
public void RemoveFromCart(int id, string cartid) { //Get the cart var cartItem = _repo.Carts.Single( cart => cart.CartId == cartid && cart.RecordId == id); if (cartItem != null) { if (cartItem.Count > 1) { cartItem.Count--; } else { _repo.Delete(cartItem); } } }