public ActionResult <Coffee> Delete(int id) { var coffeeDeleted = new Coffee(); try { coffeeDeleted = _coffeeService.Delete(id); } catch { return(BadRequest("The product you are trying to delete is present in an unfulfilled order! Please fulfille the orders to delete the Product!")); } return(Ok($"Client with Name: {coffeeDeleted.Name} was Deleted!")); }
public ActionResult Deleted(CoffeeView coffee) { coffeeService.Delete(coffee.Map()); return(RedirectToAction("Index", "Coffee")); }