Skip to content

Commit

Permalink
Merge branch 'PnPPoshIssue649' of https://github.com/KoenZomers/pnpfr…
Browse files Browse the repository at this point in the history
…amework into pr460
  • Loading branch information
jansenbe committed Sep 23, 2021
2 parents fec0abb + 4144999 commit 4c7721a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/PnP.Framework/Graph/UsersUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ public static Model.User GetUser(string accessToken, string userPrincipalName, s
AccountEnabled = u.AccountEnabled,
};

// If additional properties have been provided, ensure their output gets added to the AdditionalProperties dictonary of the output
if (selectProperties != null)
{
foreach (var selectProperty in selectProperties)
{
// Ensure the requested property has been returned in the response
var property = u.GetType().GetProperty(selectProperty);
if (property != null)
{
// Add the property to the AdditionalProperties dictionary
user.AdditionalProperties.Add(selectProperty, property.GetValue(u));
}
}
}

users.Add(user);
}
}
Expand Down

0 comments on commit 4c7721a

Please # to comment.