Exemplo n.º 1
0
        public async Task <ActionResult <List <MovieViewModel> > > GetWinner(List <string> moviesIds)
        {
            var moviesViewModel = (await _movieWorldCupService.GetMovies())
                                  .Where(a => moviesIds.Contains(a.Id));

            var movies = _mapper.Map <List <Movie> >(moviesViewModel);

            var worldCup = new WorldCup(movies);

            if (!worldCup.IsValid())
            {
                return(UnprocessableEntity());
            }

            return(_mapper.Map <List <MovieViewModel> >(worldCup.RunCup()));
        }
Exemplo n.º 2
0
 public async Task <ActionResult <List <MovieViewModel> > > Get()
 {
     return((await _movieWorldCupService.GetMovies())
            .ToList());
 }