我有一段代码,我尝试转换为.NET Core
public static bool IsAnonymousType(Type t)
{
return Attribute.IsDefined(t, typeof(CompilerGeneratedAttribute), false)
&& t.GetTypeInfo().IsGenericType
&& (t.Name.Contains("AnonymousType") || t.Name.Contains("AnonType"))
&& (t.Name.StartsWith("<>", StringComparison.Ordinal) || t.Name.StartsWith("VB$", StringComparison.Ordinal))
&& (t.GetTypeInfo().Attributes & AnonymousTypeAttributes) == AnonymousTypeAttributes;
}
但我有
的问题 Attribute.IsDefined(t, typeof(CompilerGeneratedAttribute), false)
任何人都可以指导我关于.NET Core的等价物吗?