public IActionResult Delete(int id) { Dish dish = db.GetEntity(id); if (dish == null) { return(NotFound()); } db.Delete(id); db.Save(); return(Ok(dish)); }
public async Task <IHttpActionResult> Delete(int id) { var dish = await DishRepository.FindOneByAsync(elem => elem.Id == id); if (dish == null) { return(NotFound()); } DishRepository.Delete(dish); await UnitOfWork.CommitAsync(); return(Ok(dish)); }
public ActionResult Delete(int id) { Employee em = (Employee)Session[CommonConstants.USER_SESSION]; var dish = _dishRepo.GetById(id); dish.ModifyBy = em.id; var result = _dishRepo.Delete(dish); if (result == 1) { return(Json(new { status = 1, message = "Xóa thành công" }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = 1, message = "Xóa thất bại" }, JsonRequestBehavior.AllowGet)); }
public void Delete(string DishName) { DishRepository.Delete(DishName); }