Пример #1
0
        public override async Task <PagedResultDto <BrandDto> > GetAll(PageResultRequestSearch input)
        {
            CommonMethod method = new CommonMethod();
            var          sql    = method.BuildSqlWhere(input.where, "dbo.CRM_Brand");

            CheckGetAllPermission();

            var query = CreateFilteredQuery(input).FromSql(sql);

            var totalCount = await AsyncQueryableExecuter.CountAsync(query);

            query = ApplySorting(query, input);

            query = ApplyPaging(query, input);

            var entities = await AsyncQueryableExecuter.ToListAsync(query);

            return(new PagedResultDto <BrandDto>(
                       totalCount,
                       entities.Select(MapToEntityDto).ToList()
                       ));
        }