title: IsUserInRole calls GetRolesForUser?
body: <p>When I implement the RoleProvider class and call Roles.IsUserInRole(string username, string roleName), code execution first goes to the method 'GetRolesForUser(string username)'.  Why is this?  I don't want to iterate all roles when I am just looking for the single value of whether that user belongs in one role.  Is this a limitation of .NET's role provider class or is there something I can do to control the execution of code a bit more?</p>
  
  <p>Here's the calling code</p>
  
  <pre><code>if (Roles.IsUserInRole(CurrentUser.UserName, "Teacher")) {
  </code></pre>
  
  <p>And here's the implementation of IsUserInRole</p>
  
  <pre><code>public override bool IsUserInRole(string username, string roleName) { return true; }
  </code></pre>
  
  <p>But the code GetRolesForUser always gets implemented first:</p>
  
  <pre><code>public override string[] GetRolesForUser(string username) {
          string[] roles = GetAllRoles();
          List&lt;string&gt; userRoles = new List&lt;string&gt;();
          foreach (string role in roles) {
              if (IsUserInRole(username, role)) {
                  userRoles.Add(role);
              }
          }
          return userRoles.ToArray();
      }
  </code></pre>