public async Task <IActionResult> Get() { var entity = await repository.GetAllAsync(); if (entity == null || !entity.Any()) { return(NotFound()); } return(Ok(entity)); }
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)); }
public virtual async Task <List <T> > GetAllAsync() { return((await _repository.GetAllAsync()).ToList()); }
public static Task <FindResults <T> > GetAllAsync <T>(this IReadOnlyRepository <T> repository, CommandOptionsDescriptor <T> options = null) where T : class, new() { return(repository.GetAllAsync(options.Configure())); }
public async Task <ProductGetModel[]> GetByAll() { var result = await _readOnly.GetAllAsync <Product>(); return(_mapper.Map <ProductGetModel[]>(result)); }
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))); }