public PlayerWithFiltersForCountSpecificication(PlayerSpecParams playerParams)
     : base(x =>
            (string.IsNullOrEmpty(playerParams.Search) || x.Name.ToLower().Contains(playerParams.Search)) &&
            (!playerParams.CountryId.HasValue || x.CountryId == playerParams.CountryId) &&
            (!playerParams.GameId.HasValue || x.GameId == playerParams.GameId)
            )
 {
 }
Beispiel #2
0
 public PlayersWithCountryAndGamesSpecification(PlayerSpecParams playerParams) : base(x =>
                                                                                      (string.IsNullOrEmpty(playerParams.Search) || x.Name.ToLower().Contains(playerParams.Search)) &&
                                                                                      (!playerParams.CountryId.HasValue || x.CountryId == playerParams.CountryId) &&
                                                                                      (!playerParams.GameId.HasValue || x.GameId == playerParams.GameId)
                                                                                      )
 {
     AddInclude(x => x.CountryInfo);
     AddInclude(x => x.GameInfo);
     AddOrderBy(x => x.Name);
     ApplyPaging(playerParams.PageSize * (playerParams.PageIndex - 1), playerParams.PageSize);
 }