I\'m trying to make some code more readable. For Example foreach(var row in table) {...}
rather than foreach(DataRow row in table.Rows) {...}
.
Your extension is equivalent to:
public static IEnumerable GetEnumerator( this DataTable tbl ) {
foreach ( TDataRow r in tbl.Rows ) yield return r;
}
GetEnumerator
is not the same method as GetEnumerator
This will work better:
public static IEnumerable GetEnumerator( this DataTable tbl ) {
foreach (DataRow r in tbl.Rows ) yield return r;
}