为什么getMethod()在这种情况下返回null?

时间:2016-09-19 13:38:07

标签: c# .net reflection

var v = xyz.GetType();    
var generic = v.GetMethod("Update", new Type[] { typeof(IEnumerable<>) });//returns null

...

public class Xyz
{
    public void Update<T>(IEnumerable<T> translations) where T : ijk
...

调用v.GetMethods()[1]会返回正确的方法。

0 个答案:

没有答案
相关问题