public void ShouldRequireValidProductId() { var command = new DeleteProductByIdCommand { Id = 99 }; FluentActions.Invoking(() => SendAsync(command)).Should().Throw <NotFoundException>(); }
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)); }