예제 #1
0
        public StreamingScope()
        {
#endif
            _instances = new Queue <WeakReference <DbDataReader> >();

            _parent    = Head.Value;
            Head.Value = this;
        }
예제 #2
0
        /// <summary>
        /// Begins a new streaming scope letting commands with datareaders know to stream results instead of buffer.
        /// </summary>
        /// <exception cref="SecurityException">The caller does not have the required permission.</exception>
        public StreamingScope(bool requireThreadAffinity = true)
        {
            _requireThreadAffinity = requireThreadAffinity;

            if(_requireThreadAffinity)
                Thread.BeginThreadAffinity();

            _instances = new Queue<WeakReference<IDataReader>>();

            _parent = Head.Value;
            Head.Value = this;
        }
예제 #3
0
        /// <summary>
        /// Begins a new streaming scope letting commands with datareaders know to stream results instead of buffer.
        /// </summary>
        /// <exception cref="SecurityException">The caller does not have the required permission.</exception>
        public StreamingScope(bool requireThreadAffinity = true)
        {
            _requireThreadAffinity = requireThreadAffinity;

            if (_requireThreadAffinity)
            {
                Thread.BeginThreadAffinity();
            }

            _instances = new Queue <WeakReference <IDataReader> >();

            _parent    = Head.Value;
            Head.Value = this;
        }