コード例 #1
0
 public void Handle(BrandDescriptionChangedEvent @event)
 {
     try
     {
         EventStore.Save(@event);
     }
     catch
     {
         throw;
     }
 }
コード例 #2
0
        public async Task ChangeBrandDescription(Guid brandId, string description)
        {
            try
            {
                var brand = await Repository.GetByKeyAsync <Brand>(brandId);

                brand.ChangeDescription(description);

                await Repository.SaveChangesAsync();

                var @event = new BrandDescriptionChangedEvent(brandId, description);
                EventBus.RaiseEvent(@event);
            }
            catch
            {
                throw;
            }
        }