public static ApplicationContainer Build(string redisConnectionString)
        {
            var redisProjectionsBuilder         = RedisProjectionsBuilder.NewWith(redisConnectionString);
            var domainEventProjectionsContainer = DomainEventProjectionsContainerBuilder.New()
                                                  .Use(redisProjectionsBuilder.BuildCreatedUsersViewProjection())
                                                  .Build();

            var domainEventResolver = NewtonSoftDomainEventResolver.New();

            return(new ApplicationContainer(
                       domainEventProjectionsContainer,
                       domainEventResolver));
        }
Exemple #2
0
        public static ApplicationContainer Build(
            string connectionString,
            string eventStoreName,
            IReadOnlyList <AggregateTypeCacheExpiration> aggregateTypeCacheExpirations)
        {
            var store               = Store.NewUsing(connectionString, eventStoreName);
            var cachedStore         = StoreCache.NewUsing(aggregateTypeCacheExpirations, store);
            var domainEventResolver = NewtonSoftDomainEventResolver.New();

            var commandHandlerContainer = CommandHandlerContainerBuilder.New()
                                          .Use(cachedStore)
                                          .Build();

            var domainEventHandlerContainer = DomainEventHandlerContainerBuilder.New()
                                              .Use(cachedStore)
                                              .Build();

            return(new ApplicationContainer(
                       commandHandlerContainer,
                       domainEventHandlerContainer,
                       domainEventResolver));
        }