Exemplo n.º 1
0
        /// <summary>
        ///  Handle the command with context
        /// </summary>
        /// <param name="command">The command to handle</param>
        /// <param name="context">The correlation context</param>
        /// <returns></returns>
        public async Task <ProductDto> HandleAsync(GetProduct query)
        {
            var model = await _productsRepository.GetAsync(query.Id);

            return(model == null ? null : _mapper.Map <ProductDto>(model));

            /*new ProductDto
             * {
             *  Id = product.Id,
             *  Name = product.Name,
             *  Description = product.Description,
             *  Vendor = product.Vendor,
             *  Price = product.Price
             * };*/
        }