public void DeleteHorse(int id) { var horseToDelete = _horseService.GetHorseById(id); if (horseToDelete == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } _horseService.DeleteHorse(horseToDelete.FirstOrDefault()); }
public IActionResult DeleteHorse(int HorseId) { var model = IHorseService.DeleteHorse(HorseId); return(RedirectToAction("GetHorses")); }