Esempio n. 1
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));
        }
Esempio n. 2
0
 public static IDomainEventHandler StubbedDomainEventHandlerContainerUsing(IStore store) =>
 DomainEventHandlerContainerBuilder.New()
 .Use(store)
 .Build();