コード例 #1
0
        public async Task <IActionResult> RestockProduct(Guid productId, [FromBody] int amountToAdd)
        {
            var command = new RestockProductCommand(productId, amountToAdd);
            var result  = await CartSystem.RestockProduct(command);

            if (result.IsSuccessful)
            {
                return(Ok());
            }
            return(BadRequest(result.Message));
        }
コード例 #2
0
 public async Task <CommandResult> RestockProduct(RestockProductCommand command)
 {
     return(await _commandActor.Ask <CommandResult>(command));
 }