Пример #1
0
 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}");
     }
 }
Пример #2
0
        public ActionResult Get(int id)
        {
            var apiResult = TryExecute(() => _awardRepository.Get(id), "Award Fetched sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public Award GetAward(string title)
        {
            var award = awardRepository.Get(a => a.Title == title);

            return(award);
        }