public void Handle(CategoryDescriptionChangedEvent @event) { try { EventStore.Save(@event); } catch { throw; } }
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; } }