public ActionResult <IEnumerable <MovieResponse> > GetAllMovies(int?cinemaId) { List <MovieResponse> movieResponses = movieServices.GetAllMovies(cinemaId); if (movieResponses == null) { return(NotFound()); } return(movieResponses); }
public HttpResponseMessage Get() { var movies = _movieServices.GetAllMovies(); if (movies != null) { var movieEntities = movies as List <MovieEntity> ?? movies.ToList(); if (movieEntities.Any()) { return(Request.CreateResponse(HttpStatusCode.OK, movieEntities)); } } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Movies are all not available.")); }