当我尝试将 JSON 响应转换为Graph.EducationAssignment
根对象时,没有数据。我没有收到错误消息,只是一个空对象。
我打电话/beta/education/classes/{classId}/assignments
HttpResponseMessage response = await HttpClient.GetAsync(webApiUrl);
if (response.IsSuccessStatusCode)
{
string json = await response.Content.ReadAsStringAsync();
Microsoft.Graph.EducationAssignment Assignments =
JsonConvert.DeserializeObject<Microsoft.Graph.EducationAssignment>(json);
// List<Microsoft.Graph.EducationAssignment> Assignments1 =
// JsonConvert.DeserializeObject<List<Microsoft.Graph.EducationAssignment>>(json);
}
由于响应的大小,这里是第一行,它表明分配保存在一个数组中。
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('id')/assignments",
"value": [
{
"classId": "blah-blah",
"displayName": "The homeless",
"closeDateTime": null
如果有人可以帮助我,我将不胜感激。