Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            var apiResult = TryExecute(() =>
            {
                _awardRepository.Delete(id);
                _unitOfWork.Commit();
                return(true);
            }, "Award deleted sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
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}");
     }
 }
Exemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            var award = repository.GetById(id);

            if (award == null)
            {
                return(RedirectToAction("AwardNotFound"));
            }

            repository.Delete(award);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
 public void Delete(AwardModel entity)
 {
     _awardRepository.Delete(AwardMapper.ToEntity(entity));
 }
Exemplo n.º 5
0
 public void Delete(string id)
 {
     repository.Delete(id);
 }