问题
What is the CQLINQ to get list of methods returning a (compatible) specific type or interface?
回答1:
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 }
来源:https://stackoverflow.com/questions/29505525/cqlinq-for-list-of-methods-returning-a-specific-type-or-interface