Пример #1
0
        public async Task <IActionResult> GetAll([FromQuery] ProductRequestAllDto requestAll)
        {
            if (requestAll == null)
            {
                return(BadRequest(ListDto <ProductDto> .Empty()));
            }

            var response = await _productDomainService.GetAllAsync <ProductDto>(requestAll,
                                                                                (p) => requestAll.Description.IsNullOrEmpty() || p.Description.Contains(requestAll.Description));

            return(CreateResponseOnGetAll(response, name));
        }
Пример #2
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));
        }