Attribute.IsDefined equivalent in .NET Core?
<p>I have a block of code that I tried convert to .NET Core</p>

<pre><code>    public static bool IsAnonymousType(Type t)
    {
        return Attribute.IsDefined(t, typeof(CompilerGeneratedAttribute), false)
            &amp;&amp; t.GetTypeInfo().IsGenericType
                &amp;&amp; (t.Name.Contains("AnonymousType") || t.Name.Contains("AnonType"))
                    &amp;&amp; (t.Name.StartsWith("&lt;&gt;", StringComparison.Ordinal) || t.Name.StartsWith("VB$", StringComparison.Ordinal))
                        &amp;&amp; (t.GetTypeInfo().Attributes &amp; AnonymousTypeAttributes) == AnonymousTypeAttributes;
    }
</code></pre>

<p>but I have problem with </p>

<pre><code>  Attribute.IsDefined(t, typeof(CompilerGeneratedAttribute), false)
</code></pre>

<p>Can anyone guide me about .NET Core equivalent ?</p>