Accepted answer

iqueryable objects are produced by queryable providers (ex. linq to sql, linq to entities/entity framework, etc). virtually nothing you can instantiate with new in the basic .net framework implements iqueryable.

iqueryable is an interface designed to be used to create queryable providers, which allow the linq library to be leveraged against an external data store by building a parse-able expression tree. by nature, queryables require a context - information regarding what exactly you're querying. using new to create any iqueryable type, regardless of whether it's possible, doesn't get you very far.

that being said, any ienumerable can be converted into an iqueryable by using the asqueryable() extension method. this creates a superficially-similar, but functionally very different construct behind the scenes as when using linq methods against a plain ienumerable object. this is probably the most plentiful source of queryables you have access to without setting up an actual iqueryable provider. this changeover is very useful for unit-testing linq-based algorithms as you don't need the actual data store, just a list of in-memory data that can imitate it.


well, your question is kinda weird... but i believe that if you look at an interface in reflector, it will give you a list of implementers in the loaded assemblies.

as a disclaimer i have not used reflector since it went pay-for-play so i might be wrong.


entitycollection does, as does enumerablequery.

not that i think either of these is going to get you anywhere. to help, we need to know what you are really trying to solve. if you are writing a linq provider, you should read this:

they recommend writing your own implementation.

Related Query