public void RebuildProjectionsWithCustomTake()
        {
            CanGetAggregateRoot();
            var projectionManager = new ProjectionManager(new MemoryProjectionFactory(typeof(AccountProjection)));

            var projectionCatalog = new ProjectionCatalog();

            projectionCatalog.Add(new ProjectionEntry(typeof(AccountAggregateRoot), typeof(AccountProjection), projectionManager));

            var projectionDispatcher = new ProjectionDispatcher(new ProjectionManagerFactory(projectionCatalog));

            var initializer = new ProjectionInitializer <AccountAggregateRoot>(EventStore, projectionDispatcher);

            initializer.Initialize(500);
        }
        public void RebuildProjectionsAsync()
        {
            CanGetAggregateRoot();
            var projectionManager = new ProjectionManager(new MemoryProjectionFactory(typeof(AccountProjection)));

            var projectionCatalog = new ProjectionCatalog();

            projectionCatalog.Add(new ProjectionEntry(typeof(AccountAggregateRoot), typeof(AccountProjection), projectionManager));

            using (var projectionDispatcher = new QueueProjectionDispatcher(new ProjectionDispatcher(new ProjectionManagerFactory(projectionCatalog))))
            {
                var initializer = new ProjectionInitializer <AccountAggregateRoot>(EventStore, projectionDispatcher);
                initializer.InitializeAsync().Wait();

                projectionDispatcher.Wait();
            }
        }
        public void ProjectOnBackground()
        {
            var projectionManager = new ProjectionManager(new MemoryProjectionFactory(typeof(AccountProjection)));

            var projectionCatalog = new ProjectionCatalog();

            projectionCatalog.Add(new ProjectionEntry(typeof(AccountAggregateRoot), typeof(AccountProjection), projectionManager));

            var projectionDispatcher = new QueueProjectionDispatcher(new ProjectionDispatcher(new ProjectionManagerFactory(projectionCatalog)));

            var announcer = new ProjectionEventStoreTransactionAnnouncer(EventStore, projectionDispatcher);

            var result = base.CanGetAggregateRoot();

            var waiter = new EventStoreProjectionWaiter(projectionDispatcher);

            waiter.Wait(result);

            //Created createdDomainEvent = null;

            //var domainEventCatalog = new DomainEventCatalog();
            //domainEventCatalog.Add(new DomainEventEntry(typeof(Created), new ActionDomainEventHandler<Created>((created) => createdDomainEvent = created)));
            //var announcer2 = new DomainEventDispatcherEventStoreTransactionAnnouncer(EventStore, new DomainEventDispatcher(new DomainEventHandlerFactory(domainEventCatalog), new DomainEventHandlerContextFactory(new Collection<IMetaFactory>())));
        }