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

            _parent    = Head.Value;
            Head.Value = this;
        }
Exemple #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;
        }
Exemple #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;
        }