Is thread-safe to use the 'yield' operator inside a static method'?
- by SDReyes
Is a static method using yield thread-safe?
For example:
public static T Select<T>( this IDataReader reader, Func<IDataReader, T> convertString )
{
{
while( reader.Read( ) )
yield return convertString( reader );
}
}