Example #1
0
        public IInternalConnection Reserve(string connectionString, IConnectionParameters parameters, IEventNotifier eventNotifier)
        {
            return(Pools.GetOrAdd(connectionString, _ =>
            {
#if ENABLE_ARRAY_POOL
                var internalConnectionFactory = new InternalConnectionFactory(parameters, BufferPool);
#else
                var internalConnectionFactory = new InternalConnectionFactory(parameters);
#endif
                return new ConnectionPool(parameters, internalConnectionFactory);
            }).Reserve(eventNotifier));
        }
Example #2
0
        public IInternalConnection Reserve(string connectionString, IConnectionParameters parameters, IInfoMessageEventNotifier eventNotifier, RemoteCertificateValidationCallback userCertificateValidationCallback = null)
        {
            return(Pools.GetOrAdd(connectionString, _ =>
            {
#if ENABLE_ARRAY_POOL
                var internalConnectionFactory = new InternalConnectionFactory(parameters, BufferPool, userCertificateValidationCallback);
#else
                var internalConnectionFactory = new InternalConnectionFactory(parameters, userCertificateValidationCallback);
#endif

                return new ConnectionPool(parameters, internalConnectionFactory);
            }).Reserve(eventNotifier));
        }