DelegateAuthenticationProvider not found after updating Microsoft Graph

c# - DelegateAuthenticationProvider not found after updating Microsoft Graph - Stack Overflow

回答

msgraph-sdk-dotnet/upgrade-to-v5.md at feature/5.0 · microsoftgraph/msgraph-sdk-dotnet · GitHub

 

var authenticationProvider = new BaseBearerTokenAuthenticationProvider(new TokenProvider());
            var graphClient = new GraphServiceClient(authenticationProvider);

var userResponse = await graphClient.Users
                .GetAsync(r=>
                {
                    r.QueryParameters.Top = 10;
                    r.QueryParameters.Count = true;
                    r.Headers.Add("ConsistencyLevel", "eventual");
                    r.QueryParameters.Search = $"\"displayName:{condition}\" OR \"mail:{condition}\"";
                });
            return userResponse.Value.ToArray();

 

posted @ 2023-03-06 12:37  ChuckLu  阅读(544)  评论(0)    收藏  举报