Example #1
0
 public void Handle(ProductPriceSetEvent @event)
 {
     try
     {
         EventStore.Save(@event);
     }
     catch
     {
         throw;
     }
 }
Example #2
0
        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;
            }
        }