示例#1
0
        public async Task <IResponseEntity> GetAllAsync(ResourceFilterRequest req)
        {
            var key         = req?.Key;
            var withDisable = req != null ? req.WithDisable : false;
            var list        = await _sysResourceRepository.Select
                              .WhereIf(key.IsNotNull(), a => (a.Title.Contains(key) || a.Code.Contains(key)))
                              .WhereIf(!withDisable, a => a.IsDisabled == false)
                              .OrderBy(true, a => a.OrderIndex)
                              .ToListAsync();

            var result = _mapper.Map <List <ResourceForListResponse> >(list);

            return(ResponseEntity.Ok(result));
        }
 public async Task <IResponseEntity> GetAll(ResourceFilterRequest req)
 {
     return(await _sysResourceService.GetAllAsync(req));
 }