public IActionResult Delete(int id) { try { deleteGenre.Execute(id); return(StatusCode(204)); } catch (EntityNotFoundException e) { return(NotFound(new { Errors = new List <string> { e.Message } })); } catch (Exception e) { return(StatusCode(500, new { Errors = new List <string> { e.Message } })); } }
public IActionResult Delete(int id) { try { deleteGenre.Execute(id); return(NoContent()); } catch (EntityNotFoundException e) { return(UnprocessableEntity(e.Message)); } catch (Exception e) { return(StatusCode(500)); } }
public IActionResult Delete(string id) { try { _deleteGenre.Execute(id); return(NoContent()); } catch (EntityNotFoundException) { return(NotFound()); } catch { return(StatusCode(500, "Internal Server Error")); } }