Пример #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>();
 }