public ActionResult <StockLevel> Add(
            int productId,
            [FromBody] AddStocksCommand command,
            [FromServices] AddStocks useCase
            )
        {
            var product    = useCase.Handle(productId, command.Amount);
            var stockLevel = new StockLevel(product.QuantityInStock);

            return(Ok(stockLevel));
        }
예제 #2
0
        public ActionResult <StockLevel> Add(
            int productId,
            [FromBody] AddStocksCommand command,
            [FromServices] AddStocks useCase
            )
        {
            var product    = useCase.Handle(productId, command.Amount);
            var stockLevel = _mappingService.Map <Product, StockLevel>(product);

            return(Ok(stockLevel));
        }