public async Task <IActionResult> Get()
        {
            var entity = await repository.GetAllAsync();

            if (entity == null || !entity.Any())
            {
                return(NotFound());
            }
            return(Ok(entity));
        }
Пример #2
0
        public async Task <IEnumerable <TModel> > GetAllAsync()
        {
            var entities = await _repository.GetAllAsync(CancellationToken.None, _includeProperties);

            if (entities == null)
            {
                return(Enumerable.Empty <TModel>());
            }

            return(entities.Select(CreateModel));
        }
Пример #3
0
 public virtual async Task <List <T> > GetAllAsync()
 {
     return((await _repository.GetAllAsync()).ToList());
 }
Пример #4
0
 public static Task <FindResults <T> > GetAllAsync <T>(this IReadOnlyRepository <T> repository, CommandOptionsDescriptor <T> options = null) where T : class, new()
 {
     return(repository.GetAllAsync(options.Configure()));
 }
Пример #5
0
        public async Task <ProductGetModel[]> GetByAll()
        {
            var result = await _readOnly.GetAllAsync <Product>();

            return(_mapper.Map <ProductGetModel[]>(result));
        }
Пример #6
0
        public async Task <CustomerGetModel[]> GetByAll()
        {
            var result = await _readOnly.GetAllAsync <Customer>();

            return(_mapper.Map <CustomerGetModel[]>(result));
        }
        public async Task <IEnumerable <TApplicationModel> > GetAll()
        {
            var accounts = await _repository.GetAllAsync(_query.Build());

            return(accounts.Select(x => _mapper.Map <TDataModel, TApplicationModel>(x)));
        }