获取返回(兼容)特定类型或接口的方法列表的CQLINQ是什么?
答案 0 :(得分:2)
您可以从此类查询中获取灵感:
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 }