Exemplo n.º 1
0
 public void Handle(ProductRemovedFromSaleEvent @event)
 {
     try
     {
         EventStore.Save(@event);
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 2
0
        public async Task RemoveProductFromSale(Guid productId)
        {
            try
            {
                var product = await Repository.GetByKeyAsync <Product>(productId);

                product.RemoveFromSale();

                await Repository.SaveChangesAsync();

                var @event = new ProductRemovedFromSaleEvent(productId);
                EventBus.RaiseEvent(@event);
            }
            catch
            {
                throw;
            }
        }