Graph.UserUtility getting users runs into an error when adding Id to selectedProperties
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
The ListUsers and ListUserDelta functions in the PnP.Framework.Graph.UsersUtility are running into the following issue when the selectedProperties include "Id".
Object of type 'System.String' cannot be converted to type 'System.Nullable`1[System.Guid]'.
This seems to be the case because of the MapUserEntity function trying to re-set the Id property if it is part of the selectedProperties without converting it to a Guid as required by the model.
The workaround is simply removing "Id" from selectedProperties when calling the function as Id is returned by default, but maybe the function should catch this as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in PnP.Framework.Graph.UsersUtility by tracing ListUsers and ListUserDelta into MapUserEntity, focusing on how Id is handled when included in selectedProperties. Reproduce the reported nullable Guid conversion error, then verify that both functions accept Id in selectedProperties and return it without an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100