public HttpResponseMessage Get() { var genres = _genreServices.GetAllGenres(); if (genres != null) { var genreEntities = genres as List <GenreEntity> ?? genres.ToList(); if (genreEntities.Any()) { return(Request.CreateResponse(HttpStatusCode.OK, genreEntities)); } } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Movies are all not available.")); }
public async Task <IEnumerable <GenreViewModel> > Get() { return(await _services.GetAllGenres()); }
// GET: api/Genre public IEnumerable <GenreDto> Get() { return(_genreServices.GetAllGenres()); }