使用CQLinq创建类型时查询

时间:2015-11-26 13:26:27

标签: c# .net ndepend cqlinq

假设我有以下代码:

public abstract class MyBase
{
}
public class MyImplementation : MyBase
{
}
public class MyService1
{
    MyImplementation myi = new MyImplementation();
}

public class MyService2
{
    public void Foo()
    {
        MyImplementation myi = new MyImplementation();
    }
}

是否可以使用CQLinq创建一个查询,该查询返回一个类继承自MyBase并在new某处创建的所有位置(或类型)?

查询应该返回MyService1MyService2,或者更好MyService2.Foo()

到目前为止:

from  x in Application.Types
where x.DeriveFrom("MyNamespace.MyBase")
select x

0 个答案:

没有答案