In picture :
How does AsEnumerable
Methods Knows that the type should be DataRow
?
I've searched in Reflector and Datatable
does Not implement IEnumerable..
And the AsEnumerable code is:
public static IEnumerable<TSource> AsEnumerable<TSource>(this IEnumerable<TSource> source)
{
return source;
}
What am I missing ?
You're looking at the wrong AsEnumerable
method - you're calling DataTableExtensions.AsEnumerable
. rather than Enumerable.AsEnumerable
.
对于使用dotnet core并存在相同问题的任何人,您都需要在Nuget中添加“ System.Data.DataTableExtensions”
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.