microsoftgraph/msgraph-sdk-dotnet-contrib

Graph.Community.SiteUserRequest

Closed this issue · 1 comments

Can you give an example of "EnsureUser"?

I need to add an item with a people field.
Thanks

The test project has most of the requests, including EnsureUser.

var response = await gsc.GraphServiceClient
          .SharePointAPI(mockWebUrl)
          .Web
          .Request()
          .EnsureUserAsync("alexw");

Because the data passed to the EnsureUser method is sent in the request body, the method was added after the Request is instantiated. (By convention, methods/properties before the Request() call are added to the url.)