public NotificationGenerator( EventStore eventStore, NotificationStore notificationStore, ArticleSubscriptionStore articleSubscriptionStore) { this.eventStore = eventStore; this.notificationStore = notificationStore; this.articleSubscriptionStore = articleSubscriptionStore; // 接收新的预定事件 eventStore.NewEventOccured += OnNewEventOccured; }
void InitPersistence() { articleStore = new ArticleStore(); articleX = new Article("X", string.Empty); articleY = new Article("Y", string.Empty); articleZ = new Article("Z", string.Empty); articleStore.Save(articleX); articleStore.Save(articleY); articleStore.Save(articleZ); articleSubscriptionStore = new ArticleSubscriptionStore(); eventStore = new EventStore(); notificationStore = new NotificationStore(); }