public ActionResult DeleteMovie(int movieId) { try { var resultData = movieServices.DeleteMovie(movieId); return(Ok(ServicesExtension.SuccessfulResult(resultData))); } catch (Exception exp) { return(new JsonResult(ServicesExtension.ErrorResult(exp))); } }
public ActionResult GetMoviesStats() { try { var resultData = movieServices.GetMovieStats(); return(Ok(ServicesExtension.SuccessfulResult(resultData))); } catch (Exception exp) { return(new JsonResult(ServicesExtension.ErrorResult(exp))); } }
public ActionResult CreateMovie([FromBody] MovieDto movie) { try { var resultData = movieServices.CreateMovie(movie); return(Ok(ServicesExtension.SuccessfulResult(resultData))); } catch (Exception exp) { return(new JsonResult(ServicesExtension.ErrorResult(exp))); } }
public ActionResult GetMovie(int movieId) { try { var resultData = movieServices.GetMovie(movieId); if (resultData == null) { return(NotFound()); } return(Ok(ServicesExtension.SuccessfulResult(resultData))); } catch (Exception exp) { return(new JsonResult(ServicesExtension.ErrorResult(exp))); } }