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)); }
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)); }