如何确定 属性 是否为 DNX Core 5.0 中的通用类型?

How can I determine whether a property is a Generic Type in DNX Core 5.0?

以前我可以使用它来获取 class;

上的通用类型
typeof(MyClass).GetTypeInfo().DeclaredProperties.Any(p => p.PropertyType.IsGenericType)

但是,在 DNX Core 5.0 中,IsGenericType 不受支持。我现在可以用什么?

刚刚查看了此处的一些来源,确认框架中仍有一个 IsGenericType 属性。

https://github.com/aspnet/Common/blob/dev/src/Microsoft.Framework.ClosedGenericMatcher.Sources/ClosedGenericMatcher.cs#L44

以下是否有效?

typeof(MyClass).GetTypeInfo().DeclaredProperties.Any(p => p.PropertyType.GetTypeInfo().IsGenericType)