public async Task <IListDto <CustomerDto> > GetAllCustomersAsync(CustomerRequestAllDto key)
 {
     return(await GetAllAsync <CustomerDto>(key,
                                            c => (key.Cpf.IsNullOrEmpty() || c.Cpf.Equals(key.Cpf)) &&
                                            (key.Email.IsNullOrEmpty() || c.Email.Equals(key.Email)) &&
                                            (key.Rg.IsNullOrEmpty() || c.Rg.Equals(key.Rg))));
 }
Beispiel #2
0
        public Task <IListDto <CustomerDto> > GetAllAsync(CustomerRequestAllDto request)
        {
            IListDto <CustomerDto> result = new ListDto <CustomerDto> {
                HasNext = false, Items = list
            };

            return(result.AsTask());
        }
Beispiel #3
0
        public async Task <IActionResult> GetAll([FromQuery] CustomerRequestAllDto requestAll)
        {
            if (requestAll == null)
            {
                return(BadRequest(ListDto <CustomerDto> .Empty()));
            }

            var response = await _customerDomainService.GetAllAsync <CustomerDto>(requestAll,
                                                                                  (c) => requestAll.Name.IsNullOrEmpty() || c.Name.Contains(requestAll.Name));

            return(CreateResponseOnGetAll(response, _name));
        }
Beispiel #4
0
        public async Task <IActionResult> GetAll([FromQuery] CustomerRequestAllDto requestDto)
        {
            var response = await _appService.GetAllAsync(requestDto);

            return(CreateResponseOnGetAll(response, _name));
        }
Beispiel #5
0
 public async Task <IListDto <CustomerDto> > GetAllAsync(CustomerRequestAllDto request)
 => await _service.GetAllAsync <CustomerDto>(request, c => request.Name.IsNullOrEmpty() || c.Name.Contains(request.Name));
 public async Task <IListDto <CustomerDto> > GetAllAsync(CustomerRequestAllDto request)
 => await _repository.GetAllCustomersAsync(request);