title: Displaying all roles from db into dropdownlist
body: <p>I want to show all roles from db into a dropdownlist.I have override the GetAllUser method of role provider in this way.</p>
  
  <pre><code>       public string[] GetAllRoles()
           {
          string[] roles = Session.Query&lt;RoleManager&gt;()
                         .Select(r =&gt; r.roleName)
                         .ToArray();
          return roles;
           }
  </code></pre>
  
  <p>I have called this method in Controller.</p>
  
  <pre><code>    [HttpGet]
      public ActionResult DisplayAllRoles()
      {
          string[] allRoles = ((CustomRoleProvider)Roles.Provider).GetAllRoles();
          if (allRoles != null)
          {
              //bind dropDownlist list in view with all roles ???
  
              ModelState.AddModelError("", "List of All roles");
  
          }
          else ModelState.AddModelError("","No role exists.");
          return View();
      }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>     @Html.DropDownListFor( m =&gt; m.AllRoles,new SelectList (Model.AllRoles))
  </code></pre>
  
  <p>Now my question is that how can i populate a dropdownlist from that string array of roles.Can you please write the sample code for my case.</p>