1
我有从同一个父派生的不同对象的集合。LINQ其中查询不同派生类的集合
如何可以提取特定类型的对象从一个集合含有混合类型
例如
public class A {}
public class B : A {}
public class C : A {}
收集将含有B型的对象和C
我中途那里只是需要帮助填充在 '[]' 位
var x = from xTypes in xCollection where '[type of object is type B]' select xTypes;
感谢。
我喜欢扩展方法。更干净。谢谢。 – empo 2010-07-09 14:27:04