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()); } }
public Task Handle(DeleteProductEvent notification, CancellationToken cancellationToken) => Task.CompletedTask;