Пример #1
0
 public void Handle(CategoryDescriptionChangedEvent @event)
 {
     try
     {
         EventStore.Save(@event);
     }
     catch
     {
         throw;
     }
 }
Пример #2
0
        public async Task ChangeCategoryDescription(Guid categoryId, string description)
        {
            try
            {
                var category = await Repository.GetByKeyAsync <Category>(categoryId);

                category.ChangeDescription(description);

                await Repository.SaveChangesAsync();

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