public ActionResult Delete(int id) { var apiResult = TryExecute(() => { _awardRepository.Delete(id); _unitOfWork.Commit(); return(true); }, "Award deleted sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public void Delete(int id) { if (_repository.Get(id) != null) { _repository.Delete(id); } else { throw new InvalidOperationException($"There's no Award with ID value equal to {id}"); } }
public IActionResult Delete(int id) { var award = repository.GetById(id); if (award == null) { return(RedirectToAction("AwardNotFound")); } repository.Delete(award); return(RedirectToAction("Index")); }
public void Delete(AwardModel entity) { _awardRepository.Delete(AwardMapper.ToEntity(entity)); }
public void Delete(string id) { repository.Delete(id); }