title: c# Get all enum values greater than a given value?
body: <p>I have the following enumeration of membership roles:</p>
  
  <pre><code>public enum RoleName
  {
      RegisteredUser,
      Moderator,
      Administrator,
      Owner
  }
  </code></pre>
  
  <p>I want to be able to fetch all roles greater than or equal to a given role.</p>
  
  <p>For instance I input Administrator and I get an IEnumerable with <code>RoleName.Administration</code> and <code>RoleName.Owner</code></p>
  
  <p>Something of this sort:</p>
  
  <pre><code>public static void AddUserToRole(string username, RoleName level)
  {
      var roles = Enum.GetValues(typeof(RoleName)).Cast&lt;R&gt;().ToList().Where(role =&gt; level &gt; role);
  
      foreach (var role in roles)
      {
          Roles.AddUserToRole(username, role);
      }
  }
  </code></pre>