public async Task <IActionResult> Delete(Guid id)
        {
            var productEvent = new DeleteProductEvent()
            {
                Id = id
            };

            try
            {
                await _publishEndpoint.Publish <DeleteProductEvent>(productEvent);

                return(RedirectToAction(nameof(Index), new { success = true }));
            }
            catch
            {
                return(BadRequest());
            }
        }
Ejemplo n.º 2
0
 public Task Handle(DeleteProductEvent notification, CancellationToken cancellationToken) => Task.CompletedTask;