public Task <IListDto <ProductDto> > GetAllProductAsync(ProductRequestAllDto request) { IListDto <ProductDto> result = new ListDto <ProductDto> { HasNext = false, Items = list }; return(result.AsTask()); }
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)); }
// Exemplo de operação de update parcial explícito (valor resetado para mínimo) public async Task <IListDto <ProductDto> > ResetAllProductAsync(ProductRequestAllDto request) { var products = await _readRepository.GetAllProductsAsync(request); foreach (var productDto in products.Items) { productDto.Value = 1; var product = Product.Create(Notification) .WithId(productDto.Id) .WithDescription(productDto.Description) .WithValue(1) .Build(); await _repository.UpdateProductAsync(product, p => p.Value); } return(products); }
public Task <IListDto <ProductDto> > ResetAllProductAsync(ProductRequestAllDto request) { throw new NotImplementedException(); }
public async Task <IListDto <ProductDto> > GetAllProductsAsync(ProductRequestAllDto key) => await GetAllAsync <ProductDto>(key, p => key.Description.IsNullOrEmpty() || p.Description.Contains(key.Description));
public async Task <IListDto <ProductResponseDto> > GetAllProductAsync(ProductRequestAllDto request) => await _readRepository.GetAllProductsAsync(request);
public async Task <IActionResult> GetAll([FromQuery] ProductRequestAllDto requestDto) { var response = await _appService.GetAllAsync(requestDto); return(CreateResponseOnGetAll(response, _name)); }
public Task <IListDto <ProductDto> > GetAllProductsAsync(ProductRequestAllDto key) => list.ToListDto <Product, ProductDto>(false).AsTask();
public async Task <IListDto <ProductDto, Guid> > GetAllProductAsync(ProductRequestAllDto request) => await readRepository.GetAllProductsAsync(request);
public async Task <IActionResult> ResetValue([FromQuery] ProductRequestAllDto requestDto) { var products = await _appService.ResetAllProductAsync(requestDto); return(CreateResponseOnPut(products, _name)); }
public async Task <IListDto <ProductDto> > GetAllAsync(ProductRequestAllDto request) => await _service.GetAllAsync <ProductDto>(request , p => request.Description.IsNullOrEmpty() || p.Description.Contains(request.Description));