Is thread-safe to use the 'yield' operator inside an extension method'?
- by SDReyes
Would be thread-safe to use the yield operator inside an extension method?
For example:
public static CartItem GetItems( this Cart cart )
{
{
while( cart.hasNext() )
yield return cart.GetNextItem( );
}
}