# C1.Util.DX.DXUtil.GetCustomAttribute

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXUtil_GetCustomAttribute_" data-uid="C1.Util.DX.DXUtil.GetCustomAttribute*">GetCustomAttribute Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXUtil_GetCustomAttribute_" data-uid="C1.Util.DX.DXUtil.GetCustomAttribute*"></a>
<h4 id="C1_Util_DX_DXUtil_GetCustomAttribute__1_System_Reflection_MemberInfo_System_Boolean_" data-uid="C1.Util.DX.DXUtil.GetCustomAttribute``1(System.Reflection.MemberInfo,System.Boolean)">GetCustomAttribute&lt;T&gt;(MemberInfo, bool)</h4>
<div class="markdown level1 summary"><p>Gets the custom attribute.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static T GetCustomAttribute&lt;T&gt;(MemberInfo memberInfo, bool inherited = false) where T : Attribute</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetCustomAttribute(Of T As Attribute)(memberInfo As MemberInfo, Optional inherited As Boolean = False) As T</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.memberinfo">MemberInfo</a></td>
      <td><span class="parametername">memberInfo</span></td>
      <td><p>The member info.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">inherited</span></td>
      <td><p>if set to <code>true</code> [inherited].</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">T</span></td>
      <td><p>The custom attribute or null if not found.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>Type of the custom attribute.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
