更新时间:2022-12-04 17:39:59
如何像
return type.GetInterfaces()
.Where(t => t.IsGenericType)
.Select(t => t.GetGenericTypeDefinition())
.Any(t => t.Equals(typeof(IDictionary<,>)));
我敢肯定,你可以很容易地概括为任何泛型类型定义。
which I'm sure that you can easily generalize for any generic type definition.