Exemplo n.º 1
0
 /// <summary>
 /// Creates the factory.
 /// </summary>
 /// <param name="connectionString">The connection string.</param>
 /// <returns></returns>
 private static IConnectionFactory CreateFactory(string connectionString){
     var builder = new MongoConnectionStringBuilder(connectionString);
     
     if(builder.Pooled)
         return new PooledConnectionFactory(connectionString);
     
     return new SimpleConnectionFactory(connectionString);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionFactoryBase"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        protected ConnectionFactoryBase(string connectionString)
        {
            if (connectionString == null)
                throw new ArgumentNullException("connectionString");

            ConnectionString = connectionString;
            Builder = new MongoConnectionStringBuilder(connectionString);
        }