예제 #1
0
        public virtual IConnection Get(string connectionName = null)
        {
            connectionName ??= Connections.DefaultConnectionName;

            return(_connections.GetOrAdd(
                       connectionName, () =>
                       ConnectionFactoryWrapper.CreateConnection(connectionName)
                       ));
        }
예제 #2
0
 public DefaultConnectionPool(ConnectionFactoryWrapper connectionFactoryWrapper)
 {
     ConnectionFactoryWrapper = connectionFactoryWrapper;
     _connections             = new ConcurrentDictionary <string, IConnection>();
 }