public async Task <IActionResult> DeleteMovie(int id) { if (!await _movieData.MovieExists(id)) { return(NotFound()); } try { await _movieData.DeleteMovie(id); return(NoContent()); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }