コード例 #1
0
 internal EventStoreConfigurator RegisterMongoEventStore(IContainer container)
 {
     var appSettings = container.GetInstance<AppSettings>();
     var mongoEvents = new MongoInstance(appSettings.EventsConnectionString);
     var eventStore = new MongoEventStore(mongoEvents.GetDatabase(), EventStoreSettings.GetDefault());
     container.Configure(config => config.For<IEventStore>().Singleton().Use(eventStore));
     
     return this;
 }
コード例 #2
0
        internal UniformConfigurator RegisterMongoUniform(IContainer container)
        {
            var appSettings = container.GetInstance<AppSettings>();
            var mongoView = new MongoInstance(appSettings.ViewConnectionString);

            UniformContext uniformContext = new MongoContext(mongoView.GetDatabase(), ViewContextClassMap.GetClassMap());
            container.Configure(config => config.For<UniformContext>().Singleton().Use(uniformContext));

            return this;
        }
コード例 #3
0
        public LoggingConfigurator RegisterMongoDomainLogger(IContainer container)
        {
            var appSettings = container.GetInstance<AppSettings>();

            var mongoLogs = new MongoInstance(appSettings.LogsConnectionString);
            var domainLogs = mongoLogs.GetDatabase().GetCollection<MongoDomainLogRecord>("domain_logs");

            var logManager = new MongoDomainLogManager(domainLogs);
            container.Configure(config => config.For<IDomailLogManager>().Singleton().Use(logManager));
            
            return this;
        }