示例#1
0
        public async Task <IActionResult> GetMoviesBasedonSpecificUserRatings(string user)
        {
            var result = await _movieService.GetMoviesOnUserRating(user);

            return((result.MoviesResponses.FirstOrDefault().Errors == null || !result.MoviesResponses.FirstOrDefault().Errors.Any()) ? Ok(result.MoviesResponses) : ResponseStatusCodeParser.Parse(result.MoviesResponses.FirstOrDefault().Errors, result.MoviesResponses));
        }
示例#2
0
        public async Task <IActionResult> AddorUpdateMovieRating([FromBody] AddMovieRating addMovieRating)
        {
            var result = await _movieService.AddorUpdateMovieRating(addMovieRating);

            return((result.Errors == null || !result.Errors.Any()) ? Ok(result.Success) : ResponseStatusCodeParser.Parse(result.Errors, result));
        }
示例#3
0
        public async Task <IActionResult> GetMoviesOnFilterCriteria([FromBody] MovieRequest movieRequest)
        {
            var result = await _movieService.GetMoviesOnFilterCriteria(movieRequest);

            return((result.MoviesResponses.FirstOrDefault().Errors == null || !result.MoviesResponses.FirstOrDefault().Errors.Any()) ? Ok(result.MoviesResponses) : ResponseStatusCodeParser.Parse(result.MoviesResponses.FirstOrDefault().Errors, result.MoviesResponses));
        }