Sta*_*ams 4 .net c# dnx asp.net-core
以前我可以使用它来获取类的泛型类型;
typeof(MyClass).GetTypeInfo().DeclaredProperties.Any(p => p.PropertyType.IsGenericType)
Run Code Online (Sandbox Code Playgroud)
但是,在DNX Core 5.0中,IsGenericType
不受支持.我现在可以用什么?
小智 8
刚刚查看了一些源代码,确认框架中仍然存在IsGenericType属性.
以下工作如何?
typeof(MyClass).GetTypeInfo().DeclaredProperties.Any(p => p.PropertyType.GetTypeInfo().IsGenericType)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1424 次 |
最近记录: |