public async Task <ProductDTO> Handle(GetProductByIdQuery request, CancellationToken cancellationToken) { Domain.Model.Soporte.Product item = await _productRepository.GetProductById(request.Id); return(new ProductDTO( item.ProductId, item.ProductBrand, item.ProductName, item.ProductPrice )); }
public async Task <VoidResult> Handle(InsertProductCommand request, CancellationToken cancellationToken) { Domain.Model.Soporte.Product product = new Domain.Model.Soporte.Product( request.productDTO.ProductBrand, request.productDTO.ProductName, request.productDTO.ProductPrice ); await _productRepository.Insert(product); await _unitOfWork.Commit(); return(new VoidResult()); }