示例#1
0
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var resolver = eventFlowOptions
                .UseInMemoryReadStoreFor<InMemoryTestAggregateReadModel>()
                .CreateResolver();

            _readModelPopulator = resolver.Resolve<IReadModelPopulator>();
            _queryProcessor = resolver.Resolve<IQueryProcessor>();

            return resolver;
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var resolver = eventFlowOptions
                .RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
                .UseInMemoryReadStoreFor<InMemoryThingyReadModel>()
                .UseInMemoryReadStoreFor<InMemoryThingyMessageReadModel, ThingyMessageLocator>()
                .AddQueryHandlers(
                    typeof(InMemoryThingyGetQueryHandler),
                    typeof(InMemoryThingyGetVersionQueryHandler),
                    typeof(InMemoryThingyGetMessagesQueryHandler))
                .CreateResolver();

            return resolver;
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                .UseEventStore<MsSqlEventPersistence>()
                .CreateResolver();

            var databaseMigrator = resolver.Resolve<IMsSqlDatabaseMigrator>();
            EventFlowEventStoresMsSql.MigrateDatabase(databaseMigrator);
            databaseMigrator.MigrateDatabaseUsingEmbeddedScripts(GetType().Assembly);

            return resolver;
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var connectionSettings = ConnectionSettings.Create()
                .EnableVerboseLogging()
                .KeepReconnecting()
                .SetDefaultUserCredentials(new UserCredentials("admin", "changeit"))
                .Build();

            var resolver = eventFlowOptions
                .AddMetadataProvider<AddGuidMetadataProvider>()
                .UseEventStoreEventStore(new IPEndPoint(IPAddress.Loopback, 1113), connectionSettings)
                .CreateResolver();

            return resolver;
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var storePath = Path.Combine(
                Path.GetTempPath(),
                Guid.NewGuid().ToString());

            Directory.CreateDirectory(storePath);

            var resolver = eventFlowOptions
                .UseFilesEventStore(FilesEventStoreConfiguration.Create(storePath))
                .CreateResolver();

            _configuration = resolver.Resolve<IFilesEventStoreConfiguration>();

            return resolver;
        }
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var connectionSettings = ConnectionSettings.Create()
                .EnableVerboseLogging()
                .KeepReconnecting()
                .SetDefaultUserCredentials(new UserCredentials("admin", "changeit"))
                .Build();

            var resolver = eventFlowOptions
                .UseInMemoryReadStoreFor<InMemoryTestAggregateReadModel>()
                .AddMetadataProvider<AddGuidMetadataProvider>()
                .UseEventStoreEventStore(new IPEndPoint(IPAddress.Loopback, 1113), connectionSettings)
                .CreateResolver();

            _queryProcessor = resolver.Resolve<IQueryProcessor>();
            _readModelPopulator = resolver.Resolve<IReadModelPopulator>();

            return resolver;
        }
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            TestDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(TestDatabase.ConnectionString.Value))
                .UseEventStore<MsSqlEventPersistence>()
                .UseMssqlReadModel<MsSqlTestAggregateReadModel>()
                .CreateResolver();

            MsSqlConnection = resolver.Resolve<IMsSqlConnection>();
            ReadModelSqlGenerator = resolver.Resolve<IReadModelSqlGenerator>();
            ReadModelPopulator = resolver.Resolve<IReadModelPopulator>();

            var databaseMigrator = resolver.Resolve<IMsSqlDatabaseMigrator>();
            EventFlowEventStoresMsSql.MigrateDatabase(databaseMigrator);
            databaseMigrator.MigrateDatabaseUsingEmbeddedScripts(GetType().Assembly);

            return resolver;
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                .RegisterServices(sr => sr.RegisterType(typeof (ThingyMessageLocator)))
                .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                .UseMssqlReadModel<MsSqlThingyReadModel>()
                .UseMssqlReadModel<MsSqlThingyMessageReadModel, ThingyMessageLocator>()
                .AddQueryHandlers(
                    typeof(MsSqlThingyGetQueryHandler),
                    typeof(MsSqlThingyGetVersionQueryHandler),
                    typeof(MsSqlThingyGetMessagesQueryHandler))
                .CreateResolver();

            var databaseMigrator = resolver.Resolve<IMsSqlDatabaseMigrator>();
            EventFlowEventStoresMsSql.MigrateDatabase(databaseMigrator);
            databaseMigrator.MigrateDatabaseUsingEmbeddedScripts(GetType().Assembly);

            return resolver;
        }
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            // Disable SSL certificate validation
            ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

            var url = Environment.GetEnvironmentVariable("ELASTICSEARCH_URL");
            if (string.IsNullOrEmpty(url))
            {
                Assert.Inconclusive("The environment variabel named 'ELASTICSEARCH_URL' isn't set. Set it to e.g. 'http://localhost:9200'");
            }

            _resolver = eventFlowOptions
                .ConfigureElasticsearch(new Uri(url))
                .UseElasticsearchReadModel<ElasticsearchTestAggregateReadModel>()
                .CreateResolver();
            _elasticClient = _resolver.Resolve<IElasticClient>();
            _readModelPopulator = _resolver.Resolve<IReadModelPopulator>();
            _readModelDescriptionProvider = _resolver.Resolve<IReadModelDescriptionProvider>();
            _readModelStore = _resolver.Resolve<IElasticsearchReadModelStore<ElasticsearchTestAggregateReadModel>>();

            return _resolver;
        }
 public static IEventFlowOptions AddAspNetCoreMetadataProviders(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.AddAspNetCore());
 }
 public static IEventFlowOptions UseEventStoreEventStore(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.UseEventStore <EventStoreEventPersistence>());
 }
 protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
 {
     return eventFlowOptions.CreateResolver();
 }
示例#13
0
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddDefaults(typeof(DomainModule).Assembly);
 }
示例#14
0
 public static IEventFlowOptions AddQueryHandlers(
     this IEventFlowOptions eventFlowOptions,
     params Type[] queryHandlerTypes)
 {
     return(eventFlowOptions.AddQueryHandlers((IEnumerable <Type>)queryHandlerTypes));
 }
        public static IEventFlowOptions RegisterModules(this IEventFlowOptions eventFlowOptions)
        {
            eventFlowOptions.RegisterModule(new TestModule());

            return(eventFlowOptions);
        }
示例#16
0
 protected override IServiceProvider Configure(IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .UseInMemorySnapshotPersistence()
            .ServiceCollection.BuildServiceProvider());
 }
示例#17
0
 protected override IEventFlowOptions Options(IEventFlowOptions eventFlowOptions)
 {
     return(base.Options(eventFlowOptions
                         .UseAutofacContainerBuilder()));
 }
 public static IEventFlowOptions UseConsoleLog(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.RegisterServices(sr => sr.Register <ILog, ConsoleLog>()));
 }
 public static IEventFlowOptions AddCommands(
     this IEventFlowOptions eventFlowOptions,
     params Type[] commandTypes)
 {
     return(eventFlowOptions.AddCommands(commandTypes));
 }
示例#20
0
 public static IEventFlowOptions UsePermanentMemoryCache(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.RegisterServices(r => r.Register <IMemoryCache, DictionaryMemoryCache>(Lifetime.Singleton)));
 }
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     // Use explicit adding of types, no need to scan assembly
     eventFlowOptions.AddJobs(
         typeof(PublishCommandJob), typeof(DispatchToAsynchronousEventSubscribersJob));
 }
示例#22
0
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddDefaults(typeof(UserModule).Assembly);
     eventFlowOptions.AddDefaults(typeof(UserCreatedEvent).Assembly);
 }
 public static IEventFlowOptions AddOwinMetadataProviders(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .AddMetadataProviders(EventFlowOwin.Assembly));
 }
 public static IEventFlowOptions AddSubscribers(
     this IEventFlowOptions eventFlowOptions,
     params Type[] subscribeSynchronousToTypes)
 {
     return(eventFlowOptions.AddSubscribers((IEnumerable <Type>)subscribeSynchronousToTypes));
 }
示例#25
0
 public static IEventFlowOptions AddJobs(
     this IEventFlowOptions eventFlowOptions,
     params Type[] jobTypes)
 {
     return(eventFlowOptions.AddJobs(jobTypes));
 }
 public static IEventFlowOptions UseHandfireJobScheduler(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.UseHangfireJobScheduler());
 }
 public abstract IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions);
 public static IEventFlowOptions UsePostgreSqlSnapshotStore(
     this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .UseSnapshotStore <PostgreSqlSnapshotPersistence>());
 }
 protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .UseInMemorySnapshotStore()
            .CreateResolver());
 }
示例#30
0
 public static IEventFlowOptions AddAggregateRoots(
     this IEventFlowOptions eventFlowOptions,
     params Type[] aggregateRootTypes)
 {
     return(eventFlowOptions);
 }
示例#31
0
 public static IEventFlowOptions AddAggregateRoots(
     this IEventFlowOptions eventFlowOptions,
     IEnumerable <Type> aggregateRootTypes)
 {
     return(eventFlowOptions);
 }
示例#32
0
 public static IEventFlowOptions ConfigureBookingCommandHandlers(this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions
            .AddDefaults(Assembly));
 }
示例#33
0
 public static IEventFlowOptions UseMongoDbEventStore(this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.UseEventStore <MongoDbEventPersistence>()
            .RegisterServices(f => f.Register <IMongoDbEventPersistenceInitializer, MongoDbEventPersistenceInitializer>()));
 }
 public static IEventFlowOptions UseAWSSnapshotStore(this IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.UseSnapshotStore <DynamoDBSnapshotStore>());
 }
示例#35
0
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddDefaults(typeof(EntityFrameworkQueryHandlersModule).Assembly);
 }
示例#36
0
 protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions.CreateResolver());
 }
示例#37
0
 public ModuleRegistration(
     IEventFlowOptions eventFlowOptions)
 {
     _eventFlowOptions = eventFlowOptions;
 }
示例#38
0
 public static IEventFlowOptions AddCommandHandlers(
     this IEventFlowOptions eventFlowOptions,
     params Type[] commandHandlerTypes)
 {
     return(eventFlowOptions.AddCommandHandlers((IEnumerable <Type>)commandHandlerTypes));
 }
示例#39
0
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     eventFlowOptions.AddQueryHandlers(typeof(ElasticsearchQueryHandlersModule).Assembly);
 }
 public void Register(IEventFlowOptions eventFlowOptions)
 {
     // Use explicite adding of types, no need to scan assembly
     eventFlowOptions.AddJobs(
         typeof (PublishCommandJob));
 }
示例#41
0
 protected virtual IEventFlowOptions Options(IEventFlowOptions eventFlowOptions)
 {
     return(eventFlowOptions);
 }
示例#42
0
 protected abstract IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions);
示例#43
0
 protected abstract IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions);