Skip to content

Commit

Permalink
Return the ID of any object not found within the Graph API
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhulen committed Dec 11, 2024
1 parent d3b3379 commit 9e8570a
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ public async Task<List<ObjectQueryResult>> GetObjectsByIds(ObjectQueryParameters
});
}

// Add to the results an `ObjectQueryResult` object for any `parameters.Ids` that are not in the results.
foreach (var id in parameters.Ids)
{
if (results.All(x => x.Id != id))
{
results.Add(new ObjectQueryResult
{
Id = id,
DisplayName = id,
ObjectType = ObjectTypes.Other
});
}
}

return results;
}

Expand Down

0 comments on commit 9e8570a

Please sign in to comment.