コード例 #1
0
        public static IEventFlowOptions ConfigureMongoDb(
            this IEventFlowOptions eventFlowOptions,
            string database)
        {
            var mongoClient = new MongoClient();

            return(eventFlowOptions
                   .ConfigureMongoDb(mongoClient, database));
        }
コード例 #2
0
        public static IEventFlowOptions ConfigureMongoDb(
            this IEventFlowOptions eventFlowOptions,
            IMongoClient mongoClient,
            string database)
        {
            IMongoDatabase mongoDatabase = mongoClient.GetDatabase(database);

            return(eventFlowOptions.ConfigureMongoDb(() => mongoDatabase));
        }
コード例 #3
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            var resolver = eventFlowOptions
                           .ConfigureMongoDb(_runner.ConnectionString, "eventflow")
                           .UseEventStore <MongoDbEventPersistence>()
                           .CreateResolver();

            return(resolver);
        }
コード例 #4
0
        public void Register(IEventFlowOptions eventFlowOptions)
        {
            // TODO: read form config
            var client = new MongoClient("mongodb://localhost:27017");

            eventFlowOptions
            .ConfigureMongoDb(client, "restairline-flight-availability-events")
            .UseMongoDbEventStore()
            .UseMongoDbSnapshotStore();
        }
コード例 #5
0
        private static IEventFlowOptions ConfigureMongoDb(
            this IEventFlowOptions eventFlowOptions,
            string url,
            string database)
        {
            MongoUrl mongoUrl    = new MongoUrl(url);
            var      mongoClient = new MongoClient(mongoUrl);

            return(eventFlowOptions
                   .ConfigureMongoDb(mongoClient, database));
        }
コード例 #6
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _runner = MongoDbRunner.Start();

            var resolver = eventFlowOptions
                           .ConfigureMongoDb(_runner.ConnectionString, "eventflow")
                           .UseMongoDbSnapshotStore()
                           .CreateResolver();


            return(resolver);
        }
コード例 #7
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _runner = MongoDbRunner.Start();
            var resolver = eventFlowOptions
                           .ConfigureMongoDb(_runner.ConnectionString, "eventflow")
                           .UseMongoDbEventStore()
                           .CreateResolver();
            var eventPersistenceInitializer = resolver.Resolve <IMongoDbEventPersistenceInitializer>();

            eventPersistenceInitializer.Initialize();

            return(resolver);
        }