Esempio n. 1
0
        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.");
            }
        }
Esempio n. 2
0
        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));
        }