阅读背景:

不能反序列化当前的JSON对象(例如,{“name”:“value”})到类型“System.Collections.Generic.List”。

来源:互联网 

I have the following code

我有以下代码。

public async Task<ActionResult> GetExtendedProperties()
        {
            Uri serviceRoot = new Uri(SettingsHelper.AzureAdGraphApiEndPoint);
            var token = AppToken.GetAppToken();
            var adClient = AuthenticationHelper.GetActiveDirectoryClient();

            Microsoft.Azure.ActiveDirectory.GraphClient.Application app = (Microsoft.Azure.ActiveDirectory.GraphClient.Application)adClient.Applications.Where(
                a => a.AppId == SettingsHelper.ClientId).ExecuteSingleAsync().Result;
            if (app == null)
            {
                throw new ApplicationException("Unable to get a reference to application in Azure AD.");
            }

            string requestUrl = string.Format("https://graph.windows.net/{0}/applications/{1}/extensionProperties?api-version=1.5", SettingsHelper.Tenant, app.ObjectId);

            HttpClient hc = new HttpClient();
            hc.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
                "Bearer", token);

            HttpResponseMessage hrm = await hc.GetAsync(new Uri(requestUrl));

            if (hrm.IsSuccessStatusCode)
            {
                string jsonresult = await hrm.Content.ReadAsStringAsync();


                return View();
            }
            else
            {
                return View();
            }
        }
public as



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: