Пример #1
0
        public async Task <List <CompanyData> > GetListAsync(
            string filterText                   = null,
            string title                        = null,
            string shortDescription             = null,
            string content                      = null,
            string sorting                      = null,
            int maxResultCount                  = int.MaxValue,
            int skipCount                       = 0,
            CancellationToken cancellationToken = default)
        {
            var query = ApplyFilter(DbSet, filterText, title, shortDescription, content);

            query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? CompanyDataConsts.GetDefaultSorting(false) : sorting);
            return(await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken));
        }
Пример #2
0
        public async Task <List <CompanyDataWithNavigationProperties> > GetListWithNavigationPropertiesAsync(
            string filterText                   = null,
            string title                        = null,
            string shortDescription             = null,
            string content                      = null,
            Guid?companyId                      = null,
            string sorting                      = null,
            int maxResultCount                  = int.MaxValue,
            int skipCount                       = 0,
            CancellationToken cancellationToken = default)
        {
            var query = GetQueryForNavigationProperties();

            query = ApplyFilter(query, filterText, title, shortDescription, content, companyId);
            query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? CompanyDataConsts.GetDefaultSorting(true) : sorting);
            return(await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken));
        }