❔ How are we able to use AsEnumerable to something old class like DataTable? Tell me like I am 10.
DataTable came first than AsEnumerable. How did they do it?
8 Replies
not sure what you mean
it's an extension method, but in general you can add new things to old code
if I wear to to check the implementation of the extention method i.e. AsEnumerable() for DataTable. What do you think we would find?
you can check it easily, i did before answering the question
it's just a custom enumerator that iterates over the rows of the table
What's the site I misplaced it.
so beautiful
hmmm
I wish I could write code like this
/// <summary>
/// This class provides a wrapper for DataTables to allow for querying via LINQ.
/// </summary>
public class EnumerableRowCollection<TRow> : EnumerableRowCollection, IEnumerable<TRow>
like what?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.