public ActionResult <Speaker> Delete(int id) { try { return(Ok(_speakerService.DeleteSpeaker(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult Delete(int id, SpeakersViewModel model) { Speakers deleteSpeaker = new Speakers(); deleteSpeaker = speakerService.GetById(id); model.InjectFrom(deleteSpeaker); speakerService.DeleteSpeaker(deleteSpeaker); return(RedirectToAction(nameof(Index))); }