Esempio n. 1
0
        public void ShouldRequireValidProductId()
        {
            var command = new DeleteProductByIdCommand {
                Id = 99
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <NotFoundException>();
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete(DeleteProductByIdCommand cmd)
        {
            _logger.LogDebug($"Delete Product {cmd?.Id}");

            //var cmd = new DeleteProductByIdCommand() { Id = id };
            var response = await _mediator.Send(cmd);

            return(Ok(response));
        }