Ejemplo n.º 1
0
 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))));
 }
Ejemplo n.º 2
0
        public Task <IListDto <CustomerDto> > GetAllAsync(CustomerRequestAllDto request)
        {
            IListDto <CustomerDto> result = new ListDto <CustomerDto> {
                HasNext = false, Items = list
            };

            return(result.AsTask());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> GetAll([FromQuery] CustomerRequestAllDto requestDto)
        {
            var response = await _appService.GetAllAsync(requestDto);

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