コード例 #1
0
ファイル: Program.cs プロジェクト: burkhartt/Bennington
        static void Main(string[] args)
        {
            var runtime = new BenningtonContentTreeSimpleCqrsRuntime();
            runtime.Start();

            var y = typeof(ContentNodeProvider);
            var z = typeof(SectionNodeProvider);
            var a = typeof(ToolLinkNodeProvider);

            var domainEventReplayer = new DomainEventReplayer(runtime);

            var eventDenormalizerTypes = GetEventDenormalizerTypes();
            foreach (var eventType in eventDenormalizerTypes)
            {
                Console.Write(string.Format("Replaying events for {0} ...", eventType.Name));
                domainEventReplayer.ReplayEventsForHandlerType(eventType);
                Console.WriteLine(" complete.");
            }
        }
コード例 #2
0
ファイル: Global.asax.cs プロジェクト: Pechalka/Diplome
        private static void ReCreateReadModels()
        {
            MongoHelper.GetCollectionOf<CompanyViewModel>().RemoveAll();
            MongoHelper.GetCollectionOf<PhotosCompanyDetailsViewModel>().RemoveAll();
            MongoHelper.GetCollectionOf<ReviewCompanyDetailsViewModel>().RemoveAll();
            MongoHelper.GetCollectionOf<CompanyWorksPage>().RemoveAll();

            var eventPlayer = new DomainEventReplayer(Runtime);

            eventPlayer.ReplayEventsForHandlerType(typeof(CompanyAddedEventHandler));
            eventPlayer.ReplayEventsForHandlerType(typeof(CompanyUpdatedEventHandler));
            eventPlayer.ReplayEventsForHandlerType(typeof(CompantReviewAddedEventHandler));
            eventPlayer.ReplayEventsForHandlerType(typeof(WorkDeletedEventHandler));
            eventPlayer.ReplayEventsForHandlerType(typeof(AddWorkEventHandler));
        }