Exemplo n.º 1
0
        public async Task <GetAllProductsByNameResponse> Handle(GetAllProductsByNameRequest message)
        {
            var products = await _productRepository.GetAllByName(message.Name);

            return(new GetAllProductsByNameResponse {
                Products = products
            });
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> SearchByName(string name)
        {
            var request = new GetAllProductsByNameRequest {
                Name = name
            };

            var response = await _productHandler.Handle(request);

            return(Ok(response.Products));
        }