Beispiel #1
0
 // Inherited from RoleProvider ==> Forwarded to previous provider if this provider hasn't been initialized
 public override string[] GetAllRoles()
 {
     if (!InitializeCalled)
     {
         return(PreviousProvider.GetAllRoles());
     }
     using (var db = ConnectToDatabase()) {
         return(db.Query(@"SELECT RoleName FROM " + RoleTableName).Select <dynamic, string>(d => (string)d[0]).ToArray());
     }
 }
Beispiel #2
0
 /// <summary>
 /// Gets a list of all the roles for the configured applicationName.
 /// </summary>
 /// <remarks>Inherited from RoleProvider ==> Forwarded to previous provider if this provider hasn't been initialized</remarks>
 /// <returns>A string array containing the names of all the roles stored in the data source for the configured applicationName.</returns>
 public override string[] GetAllRoles()
 {
     if (!InitializeCalled)
     {
         return(PreviousProvider.GetAllRoles());
     }
     using (var db = NewMySqlSecurityDbContext)
     {
         var roleNames = db.Roles.Select(x => x.RoleName).ToArray();
         return(roleNames);
     }
 }