c# - Why is IQueryable lacking all the extension methods that IQueryable<T> has? -
same ienumerable
vs ienumerable<t>
. oversight? or there problem when don't have type specified makes implementing extensions .count()
, .where()
, etc impossible?
from docs:
the iqueryable interface intended implementation query providers. supposed implemented providers also implement
iqueryable<t>
. if provider not implementiqueryable<t>
, standard query operators cannot used on provider's data source.
ienumerable
artifact of times when .net did not have generics ( don't mean deprecated, of course ). has lived on backward compatibility, after generics , hence ienumerable<t>
introduced. iqueryable
keeps consistency. basically, given there generics now, , given advantages, makes useful implement these extensions on generic interfaces. non-generic ones can converted generic ones using cast<t>
Comments
Post a Comment