https://github.com/microsoftgraph/consoleApp-deltaQuery-dotNet-sample/blob/master/Client/Client.cs#L202
private void AddHeaders(WebClient webClient)
{
webClient.Headers.Add(Constants.HeaderNameAuthorization, this.GetAccessToken().Result);
webClient.Headers.Add(HttpRequestHeader.Accept, "application/json");
}
.Result - please be async/await all the way down. The use of .Result is a very bad idea. (if not async/await then at least .GetAwaiter().GetResult())
https://github.com/microsoftgraph/consoleApp-deltaQuery-dotNet-sample/blob/master/Client/Client.cs#L202
private void AddHeaders(WebClient webClient)
{
webClient.Headers.Add(Constants.HeaderNameAuthorization, this.GetAccessToken().Result);
webClient.Headers.Add(HttpRequestHeader.Accept, "application/json");
}
.Result - please be async/await all the way down. The use of .Result is a very bad idea. (if not async/await then at least .GetAwaiter().GetResult())