Within the context of C# on .Net 4.0, are there any built-in objects that implement IQueryable<T>
?
相关问题
- Extracting from a Union Type when some have identi
- Check if tie in count of lists using linq
- How do I create a multidimensional array of object
- Trouble with OR in Sharepoint CAML
- Haskell: What is the differrence between `Num [a]
相关文章
- List可以存储接口类型的数据吗?
- 想问问Linq中有没有根据条件选择要不要关联表。
- How do I get from a type to the TryParse method?
- Why do I need a ToList() to avoid disposed context
- LINQ .Include() properties from sub-types in TPH i
- Can a method chain be called LINQ?
- Java Generics: How to specify a Class type for a g
- Get grouped comma separated values with linq
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.
IQueryable
objects are produced by Queryable Providers (ex. LINQ to SQL, LINQ to Entities/Entity Framework, etc). Virtually nothing you can instantiate withnew
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. Usingnew
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 anIQueryable
by using theAsQueryable()
extension method. This creates a superficially-similar, but functionally very different construct behind the scenes as when using LINQ methods against a plainIEnumerable
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.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: http://msdn.microsoft.com/en-us/library/bb546158.aspx.
They recommend writing your own implementation.