CQLINQ for list of methods returning a specific type or interface?

185 Views Asked by At

What is the CQLINQ to get list of methods returning a (compatible) specific type or interface?

1

There are 1 best solutions below

0
On BEST ANSWER

You can get inspiration from such query:

let listOfT = ThirdParty.Types.WithFullName(
"System.Collections.Generic.IList<T>").Single()

let compatibleTypes = listOfT.TypesThatImplementMe.Concat(listOfT)

from m in Methods.Where(m => m.ReturnType != null && compatibleTypes.Contains(m.ReturnType))
select new { m, m.ReturnType }