public ActionResult Delete(int id)
        {
            DistributorData distributor = _repository.GetById(id);

            if (distributor != null)
            {
                _repository.Remove(distributor);

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(new BadRequestResult());
            }
        }
Пример #2
0
 public void Delete(int id)
 {
     _repository.Remove(_repository.GetById(id));
 }