public DataSet GetSortedListOfRolesGroupsById(Guid organizationId) { ClientDataSet.GroupsInstancesRolesDataTable table = GroupProvider.GetGroupsInstancesRoles(organizationId); table.Columns.Add("RoleName", typeof(string)); table.Columns.Add("GroupName", typeof(string)); foreach (ClientDataSet.GroupsInstancesRolesRow row in table.Rows) { ConfigurationDataSet.RoleRow roleRow = RoleProvider.GetRoleRow((Guid)row["RoleId"]); if (row != null) { row["RoleName"] = roleRow.Name; } MasterDataSet.GroupMappingsRow[] groups = LdapInfoProvider.GetGroupMappings(organizationId).Select(string.Format(CultureInfo.InvariantCulture, "GroupId = '{0}' AND OrganizationId = '{1}'", row["GroupId"], organizationId)) as MasterDataSet.GroupMappingsRow[]; if (groups.Length > 0) { row["GroupName"] = groups[0].LdapGroupName; } } return(table.DataSet); }