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 ActionResult Get(int id) { var apiResult = TryExecute(() => _awardRepository.Get(id), "Award Fetched sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public Award GetAward(string title) { var award = awardRepository.Get(a => a.Title == title); return(award); }