public IEnumerable <BoardGame> GetBoardGamesDatabase(FilterSelection filter)
        {
            int  maxPlayingTime  = GetTimeInMinutes(filter.PlayingTime);
            bool orderMorePlayed = NumberOfPlaysEnum.MorePlayed.Equals(filter.NumberOfPlays);

            var data = _repository.GetAll()
                       .Where(g => g.Owned &&
                              (filter.NumberOfPlayers >= g.MinPlayers && filter.NumberOfPlayers <= g.MaxPlayers) &&
                              g.PlayingTime <= maxPlayingTime);

            return(orderMorePlayed
                ? data.OrderByDescending(g => g.NumPlays)
                : data.OrderBy(g => g.NumPlays));
        }
 public IEnumerable Get()
 {
     return(boardGameRep.GetAll());
 }
Exemplo n.º 3
0
 public IEnumerable <BoardGame> GetAll()
 {
     return(_boardGameRepository.GetAll());
 }