コード例 #1
0
ファイル: StreamingScope.cs プロジェクト: xiaowuwang/Susanoo
        public StreamingScope()
        {
#endif
            _instances = new Queue <WeakReference <DbDataReader> >();

            _parent    = Head.Value;
            Head.Value = this;
        }
コード例 #2
0
ファイル: StreamingScope.cs プロジェクト: Suamere/Susanoo
        /// <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;
        }