예제 #1
0
        private void SetupDatabase(IApplicationConfiguration configuration)
        {
            var mongourl = new MongoUrl(configuration.GetConnectionString("MongoDB"));
            var client   = new MongoClient(mongourl);

            database = client.GetDatabase(mongourl.DatabaseName);
        }
예제 #2
0
        public EventStoreConnectionString(string connectionStringName, IApplicationConfiguration configuration)
        {
            var connectionString = configuration.GetConnectionString(connectionStringName);

            var options = connectionString
                          .Split(';')
                          .Select(x => new ConnectionPart(x))
                          .ToDictionary(x => x.Name, x => x.Value);

            _connectionOptions = new ConnectionOptions(options, connectionStringName);
        }