Ejemplo n.º 1
0
        public async Task <List <Company> > GetListAsync(
            string filterText  = null,
            string code        = null,
            string name        = null,
            bool?isActive      = null,
            string sorting     = null,
            int maxResultCount = int.MaxValue,
            int skipCount      = 0,
            CancellationToken cancellationToken = default)
        {
            var query = ApplyFilter(DbSet, filterText, code, name, isActive);

            query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? CompanyConsts.GetDefaultSorting(false) : sorting);
            return(await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken));
        }
Ejemplo n.º 2
0
        public async Task <List <CompanyWithNavigationProperties> > GetListWithNavigationPropertiesAsync(
            string filterText  = null,
            string code        = null,
            string name        = null,
            bool?isActive      = null,
            Guid?cagegoryId    = null,
            string sorting     = null,
            int maxResultCount = int.MaxValue,
            int skipCount      = 0,
            CancellationToken cancellationToken = default)
        {
            var query = GetQueryForNavigationProperties();

            query = ApplyFilter(query, filterText, code, name, isActive, cagegoryId);
            query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? CompanyConsts.GetDefaultSorting(true) : sorting);
            return(await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken));
        }