public void Handle(ProductPriceSetEvent @event) { try { EventStore.Save(@event); } catch { throw; } }
public async Task SetProductPrice(Guid productId, Currency price) { try { var product = await Repository.GetByKeyAsync <Product>(productId); product.SetPrice(price); await Repository.SaveChangesAsync(); var @event = new ProductPriceSetEvent(productId, price); EventBus.RaiseEvent(@event); } catch { throw; } }