public StreamingScope() { #endif _instances = new Queue <WeakReference <DbDataReader> >(); _parent = Head.Value; Head.Value = this; }
/// <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; }
/// <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; }