title: Properties of nested static class
body: <p>I have this nested static class</p>
  
  <pre><code>public static class UserRoles
  {
      public static class Administrator
      {
          public static string Code =&gt; "ADMIN";
          public static string Title =&gt; "Administrator";
      }
  
      public static class ClientUser
      {
          public static string Code =&gt; "CU";
          public static string Title =&gt; "Client User";
      }
  
      public static class Driver
      {
          public static string Code =&gt; "DR";
          public static string Title =&gt; "Driver";
      }
  }
  </code></pre>
  
  <p>I am trying iterating over the properties of <code>UserRoles</code> but failed miserably. I've tried using <code>System.Reflection</code> which i think is the only suitable approach for the problem.</p>
  
  <p>I've already tried using <code>GetFields</code> with bindings and <code>GetProperties</code> but unfortunately it is not working.</p>
  
  <pre><code>var fields = myType.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
  </code></pre>
  
  <p>I've checked other questions already but i don't find any that is specific to this very basic and common case. Please let me know if this is a duplicate of anything.</p>
  
  <p>Any help would be truly appreciated.</p>