public void Handle(ProductSkuChangedEvent @event) { try { EventStore.Save(@event); } catch { throw; } }
public async Task ChangeProductSku(Guid productId, string sku) { try { var product = await Repository.GetByKeyAsync <Product>(productId); product.ChangeSku(sku); await Repository.SaveChangesAsync(); var @event = new ProductSkuChangedEvent(productId, sku); EventBus.RaiseEvent(@event); } catch { throw; } }