2

Let's say i have the follwoing code:

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();
    }
}

Is it possible to create a query with CQLinq that returns all places (or types) where a Class inherits from MyBase and is created somewhere with new ?

The query should return MyService1 and MyService2 or even better MyService2.Foo()

What i have so far:

from  x in Application.Types
where x.DeriveFrom("MyNamespace.MyBase")
select x
gsharp
  • 27,557
  • 22
  • 88
  • 134

0 Answers0