public GameWithFilterForCountSpecification(GameSpecificationParams gameParams)
     : base(x =>
            (string.IsNullOrEmpty(gameParams.Search) || x.Title.ToLower().Contains(gameParams.Search)) &&
            (!gameParams.CompanyId.HasValue || x.CompanyId == gameParams.CompanyId) &&
            (!gameParams.GenreId.HasValue || x.GenreId == gameParams.GenreId)
            )
 {
 }
        public GameWithCompaniesAndGenresSpecification(GameSpecificationParams gameParams)
            : base(x =>
                   (string.IsNullOrEmpty(gameParams.Search) || x.Title.ToLower().Contains(gameParams.Search)) &&
                   (!gameParams.CompanyId.HasValue || x.CompanyId == gameParams.CompanyId) &&
                   (!gameParams.GenreId.HasValue || x.GenreId == gameParams.GenreId)
                   )
        {
            AddInclude(g => g.Company);
            AddInclude(g => g.Genre);
            ApplyPaging(gameParams.PageSize * (gameParams.IndexPage - 1), gameParams.PageSize);

            switch (gameParams.Sort)
            {
            case SortState.TitleDesc:
                AddOrderByDescending(g => g.Title);
                break;

            case SortState.PriceAsc:
                AddOrderBy(g => g.Price);
                break;

            case SortState.PriceDesc:
                AddOrderByDescending(g => g.Price);
                break;

            case SortState.CompanyAsc:
                AddOrderBy(g => g.Company.Name);
                break;

            case SortState.CompanyDesc:
                AddOrderByDescending(g => g.Company.Name);
                break;

            default:
                AddOrderBy(g => g.Title);
                break;
            }
        }