CQLINQ是否提供返回特定类型或接口的方法列表? [英] CQLINQ for list of methods returning a specific type or interface?

查看:138
本文介绍了CQLINQ是否提供返回特定类型或接口的方法列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要获取返回(兼容)特定类型或接口的方法的列表的CQLINQ是什么?

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

推荐答案

您可以从此类查询中获得启发:

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 }

这篇关于CQLINQ是否提供返回特定类型或接口的方法列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆