【发布时间】:2011-04-09 20:16:24
【问题描述】:
我需要能够得到与以下类似的东西才能工作:
Type type = ??? // something decided at runtime with .GetType or typeof;
object[] entityList = context.Resources.OfType<type>().ToList();
这可能吗?如果有任何新功能允许,我可以使用 .NET 4。
【问题讨论】:
-
必须是 IQueryable 吗?从您的示例来看, IEnumerable 似乎就足够了。
-
@leppie 我不明白你的意思..
标签: c# linq reflection iqueryable