2017-06-16 15 views
0

ログインしている参加者のカレンダーデータを取得するためのMicrosoft Graph APIを照会するUWPアプリケーションを構築しています。私はstartend timemeeting detailsno of participants as a list with their email IDsOrganizer name and email idで利用可能なすべてのmeetingsのリストを取得することができソリューションに探しています。このJSON応答C#APIを使用したJSONオブジェクトと配列の解析

{ 
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users()/events(subject,body,bodyPreview,organizer,attendees,start,end,location)", 

    "value": [ 
     { 
      "subject": "Lets Party Harder", 
      "bodyPreview": "", 
      "body": { 
       //deleted as its pure HTML Content    }, 
      "start": { 
       "dateTime": "2017-06-14T12:00:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "end": { 
       "dateTime": "2017-06-14T12:30:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "location": { 
       "displayName": "", 
       "address": {} 
      }, 
      "attendees": [ 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       } 
      ], 
      "organizer": { 
       "emailAddress": { 
        "name": "Apoorv Kumar", 
        "address": "[email protected]" 
       } 
      } 
     }, 
     { 
      "@odata.etag": "W/\"7N0zd4iZvEqXjwOQQ+rwVAAAtC3kEw==\"", 
      "id": "AQMkADAwATM3ZmYAZS05ZDYzLWVkZjYtMDACLTAwCgBGAAAD5Yo-MIi8hUKqqYwhg_4WrAcA7N0zd4iZvEqXjwOQQ_rwVAAAAgENAAAA7N0zd4iZvEqXjwOQQ_rwVAAAALQFnyQAAAA=", 
      "subject": "All Hands Up", 
      "bodyPreview": "Hi", 
      "body": { 
       //deleted as its pure HTML content}, 
      "start": { 
       "dateTime": "2017-06-14T10:30:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "end": { 
       "dateTime": "2017-06-14T11:00:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "location": { 
       "displayName": "", 
       "address": {} 
      }, 
      "attendees": [ 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "mohit", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Apoorv K Upadhyay", 
         "address": "[email protected]" 
        } 
       } 
      ], 
      "organizer": { 
       "emailAddress": { 
        "name": "Apoorv Kumar", 
        "address": "[email protected]" 
       } 
      } 
     }, 
     { 
          "subject": "Meeting Reminder", 
      "bodyPreview": "REMINDER: To attend your 2016 Annual Health Check, as per your appointment request booking", 
      "body": { 

      }, 
      "start": { 
       "dateTime": "2017-01-21T03:30:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "end": { 
       "dateTime": "2017-01-21T03:45:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "location": { 
       "displayName": "Please refer to mail content " 
      }, 
      "attendees": [ 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       } 
      ], 
      "organizer": { 
       "emailAddress": { 
        "name": "[email protected]", 
        "address": "[email protected]" 
       } 
      } 
     }, 
     nospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">Akash Mishra</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">Kashish Gori</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">Vikas Mishra</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">[email protected]</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">Roopesh Tripathi</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">apoorv vyas</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<span style=\"font-family:Courier New,monospace\">•</span></td>\r\n<td style=\"padding-right:10px; font-family:Arial,Sans-serif; font-size:13px; color:#222\">\r\n<div>\r\n<div style=\"margin:0 0 0.3em 0\"><span itemprop=\"attendee\" itemscope=\"\" itemtype=\"http://schema.org/Person\"><span itemprop=\"name\" class=\"notranslate\">[email protected]</span>\r\n<meta itemprop=\"email\" content=\"[email protected]\">\r\n</span></div>\r\n</div>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</div>\r\n<p style=\"color:#222; font-size:13px; margin:0\"><span style=\"color:#888\">Going? </span>\r\n<wbr><strong><span itemprop=\"potentialaction\" itemscope=\"\" itemtype=\"http://schema.org/RsvpAction\">\r\n<meta itemprop=\"attendance\" content=\"http://schema.org/RsvpAttendance/Yes\">\r\n<span itemprop=\"handler\" itemscope=\"\" itemtype=\"http://schema.org/HttpActionHandler\"><link itemprop=\"method\" href=\"http://schema.org/HttpRequestMethod/GET\"><a href=\"https://www.google.com/calendar/event?action=RESPOND&amp;eid=bGdiMjFuY3I2MmZ0OWp1bW1wbmJwZGhhb2MgYXBvb3J2LnVwYWRoeWF5QGxpdmUuaW4&amp;rst=1&amp;tok=MjIjbGVhcm5iYXl0ZWNoQGdtYWlsLmNvbWQ5NDQxODM1YTNiZmRjYTU4NDk4ZWIwYWY3YWYyNWQ5YTI2MDBlNDc&amp;ctz=Asia/Calcutta&amp;hl=en\" itemprop=\"url\" style=\"color:#20c; white-space:nowrap\">Yes</a></span></span><span style=\"margin:0 0.4em; font-weight:normal\">\r\n - </span><span itemprop=\"potentialaction\" itemscope=\"\" itemtype=\"http://schema.org/RsvpAction\">\r\n<meta itemprop=\"attendance\" content=\"http://schema.org/RsvpAttendance/Maybe\">\r\n<span itemprop=\"handler\" itemscope=\"\" itemtype=\"http://schema.org/HttpActionHandler\"><link itemprop=\"method\" href=\"http://schema.org/HttpRequestMethod/GET\"><a href=\"https://www.google.com/calendar/event?action=RESPOND&amp;eid=bGdiMjFuY3I2MmZ0OWp1bW1wbmJwZGhhb2MgYXBvb3J2LnVwYWRoeWF5QGxpdmUuaW4&amp;rst=3&amp;tok=MjIjbGVhcm5iYXl0ZWNoQGdtYWlsLmNvbWQ5NDQxODM1YTNiZmRjYTU4NDk4ZWIwYWY3YWYyNWQ5YTI2MDBlNDc&amp;ctz=Asia/Calcutta&amp;hl=en\" itemprop=\"url\" style=\"color:#20c; white-space:nowrap\">Maybe</a></span></span><span style=\"margin:0 0.4em; font-weight:normal\">\r\n - </span><span itemprop=\"potentialaction\" itemscope=\"\" itemtype=\"http://schema.org/RsvpAction\">\r\n<meta itemprop=\"attendance\" content=\"http://schema.org/RsvpAttendance/No\">\r\n<span itemprop=\"handler\" itemscope=\"\" itemtype=\"http://schema.org/HttpActionHandler\"><link itemprop=\"method\" href=\"http://schema.org/HttpRequestMethod/GET\"><a href=\"https://www.google.com/calendar/event?action=RESPOND&amp;eid=bGdiMjFuY3I2MmZ0OWp1bW1wbmJwZGhhb2MgYXBvb3J2LnVwYWRoeWF5QGxpdmUuaW4&amp;rst=2&amp;tok=MjIjbGVhcm5iYXl0ZWNoQGdtYWlsLmNvbWQ5NDQxODM1YTNiZmRjYTU4NDk4ZWIwYWY3YWYyNWQ5YTI2MDBlNDc&amp;ctz=Asia/Calcutta&amp;hl=en\" itemprop=\"url\" style=\"color:#20c; white-space:nowrap\">No</a></span></span></strong>\r\n<wbr><a href=\"https://www.google.com/calendar/event?action=VIEW&amp;eid=bGdiMjFuY3I2MmZ0OWp1bW1wbmJwZGhhb2MgYXBvb3J2LnVwYWRoeWF5QGxpdmUuaW4&amp;tok=MjIjbGVhcm5iYXl0ZWNoQGdtYWlsLmNvbWQ5NDQxODM1YTNiZmRjYTU4NDk4ZWIwYWY3YWYyNWQ5YTI2MDBlNDc&amp;ctz=Asia/Calcutta&amp;hl=en\" itemprop=\"url\" style=\"color:#20c; white-space:nowrap\">more\r\n options »</a></p>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-color:#f6f6f6; color:#888; border-top:1px Solid #ccc; font-family:Arial,Sans-serif; font-size:11px\">\r\n<p>Invitation from <a href=\"https://www.google.com/calendar/\" target=\"_blank\" style=\"\">\r\nGoogle Calendar</a></p>\r\n<p>You are receiving this courtesy email at the account [email protected] because you are an attendee of this event.</p>\r\n<p>To stop receiving future updates for this event, decline this event. Alternatively you can sign up for a Google account at https://www.google.com/calendar/ and control your notification settings for your entire calendar.</p>\r\n<p>Forwarding this invitation could allow any recipient to modify your RSVP response.\r\n<a href=\"https://support.google.com/calendar/answer/37135#forwarding\">Learn More</a>.</p>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</div>\r\n</span></span>\r\n</body>\r\n</html>\r\n" 
      }, 
      "start": { 
       "dateTime": "2017-01-14T04:30:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "end": { 
       "dateTime": "2017-01-14T07:00:00.0000000", 
       "timeZone": "UTC" 
      }, 
      "location": { 
       "displayName": "Learnbay:Data Structures and Algorithms,Python,Embedded Systems Training, Learnbay,19/1,2nd Floor, Classic Aura(Beside Aricent)BLOCK 12, Marathahalli - Sarjapur Outer Ring Road, Kaverappa Layout, Kadubeesanahalli, Chandana, Bengaluru, Karnataka 560103, India" 
      }, 
      "attendees": [ 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Mohit Jain", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Nancy Goel", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Tejas Bargal", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "abhishek anand", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "sriharitej kolagani", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "RAMMOHAN CIRIGIRI", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Parag Sawant", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Abhishek Gupta", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Naveen G", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Neeraj Yadav", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Akash Mishra", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Kashish Gori", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Vikas Mishra", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "Roopesh Tripathi", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "apoorv vyas", 
         "address": "[email protected]" 
        } 
       }, 
       { 
        "type": "required", 
        "status": { 
         "response": "none", 
         "time": "0001-01-01T00:00:00Z" 
        }, 
        "emailAddress": { 
         "name": "[email protected]", 
         "address": "[email protected]" 
        } 
       } 
      ], 
      "organizer": { 
       "emailAddress": { 
        "name": "[email protected]", 
        "address": "[email protected]" 
       } 
      } 
     }, 
       ] 
} 

を受けます。

私はNewtonSoftライブラリを使用しようとしたと、このような何かをやってますがnull例外を取得JSON

public class Body 
{ 
    public string contentType { get; set; } 
    public string content { get; set; } 
} 

public class Start 
{ 
    public string dateTime { get; set; } 
    public string timeZone { get; set; } 
} 

public class End 
{ 
    public string dateTime { get; set; } 
    public string timeZone { get; set; } 
} 

public class Address 
{ 
} 

public class Location 
{ 
    public string displayName { get; set; } 
    public Address address { get; set; } 
} 

public class EmailAddress 
{ 
    public string name { get; set; } 
    public string address { get; set; } 
} 

public class Organizer 
{ 
    public EmailAddress emailAddress { get; set; } 
} 

public class Value 
{ 
    public string [email protected] { get; set; } 
    public string id { get; set; } 
    public string subject { get; set; } 
    public string bodyPreview { get; set; } 
    public Body body { get; set; } 
    public Start start { get; set; } 
    public End end { get; set; } 
    public Location location { get; set; } 
    public List<object> attendees { get; set; } 
    public Organizer organizer { get; set; } 
} 

public class RootObject 
{ 
    public string [email protected] { get; set; } 
    public string [email protected] { get; set; } 
    public List<Value> value { get; set; } 
} 

を解析するためのいくつかのクラスを生成しました。

JObject root = JObject.Parse(content); 
       JArray ValueArray = (JArray)root["value"]; 

誰かが私にそれを手伝ってもらえますか?

+0

正確な例外メッセージを指定できますか。 –

+0

まずはJSONを修正してください。その無効なjson –

+0

あなたはこのツールを使用して確認することができます:https://jsonlint.com/ –

答えて

2

ので、JSONの更新されたリンクであなたのクラスは、あなたの結果を得るために、この

public class Body 
{ 

    [JsonProperty("contentType")] 
    public string contentType 
    { 
     get; 
     set; 
    } 

    [JsonProperty("content")] 
    public string content 
    { 
     get; 
     set; 
    } 
} 

public class Start 
{ 

    [JsonProperty("dateTime")] 
    public DateTime dateTime 
    { 
     get; 
     set; 
    } 

    [JsonProperty("timeZone")] 
    public string timeZone 
    { 
     get; 
     set; 
    } 
} 

public class End 
{ 

    [JsonProperty("dateTime")] 
    public DateTime dateTime 
    { 
     get; 
     set; 
    } 

    [JsonProperty("timeZone")] 
    public string timeZone 
    { 
     get; 
     set; 
    } 
} 

public class Address 
{ 
} 

public class Location 
{ 

    [JsonProperty("displayName")] 
    public string displayName 
    { 
     get; 
     set; 
    } 

    [JsonProperty("address")] 
    public Address address 
    { 
     get; 
     set; 
    } 
} 

public class Status 
{ 

    [JsonProperty("response")] 
    public string response 
    { 
     get; 
     set; 
    } 

    [JsonProperty("time")] 
    public DateTime time 
    { 
     get; 
     set; 
    } 
} 

public class EmailAddress 
{ 

    [JsonProperty("name")] 
    public string name 
    { 
     get; 
     set; 
    } 

    [JsonProperty("address")] 
    public string address 
    { 
     get; 
     set; 
    } 
} 

public class Attendee 
{ 

    [JsonProperty("type")] 
    public string type 
    { 
     get; 
     set; 
    } 

    [JsonProperty("status")] 
    public Status status 
    { 
     get; 
     set; 
    } 

    [JsonProperty("emailAddress")] 
    public EmailAddress emailAddress 
    { 
     get; 
     set; 
    } 
} 

public class Organizer 
{ 

    [JsonProperty("emailAddress")] 
    public EmailAddress emailAddress 
    { 
     get; 
     set; 
    } 
} 

public class Value 
{ 

    [JsonProperty("@odata.etag")] 
    public string odataetag 
    { 
     get; 
     set; 
    } 

    [JsonProperty("id")] 
    public string id 
    { 
     get; 
     set; 
    } 

    [JsonProperty("subject")] 
    public string subject 
    { 
     get; 
     set; 
    } 

    [JsonProperty("bodyPreview")] 
    public string bodyPreview 
    { 
     get; 
     set; 
    } 

    [JsonProperty("body")] 
    public Body body 
    { 
     get; 
     set; 
    } 

    [JsonProperty("start")] 
    public Start start 
    { 
     get; 
     set; 
    } 

    [JsonProperty("end")] 
    public End end 
    { 
     get; 
     set; 
    } 

    [JsonProperty("location")] 
    public Location location 
    { 
     get; 
     set; 
    } 

    [JsonProperty("attendees")] 
    public IList<Attendee> attendees 
    { 
     get; 
     set; 
    } 

    [JsonProperty("organizer")] 
    public Organizer organizer 
    { 
     get; 
     set; 
    } 
} 

public class Rootobject 
{ 

    [JsonProperty("@odata.context")] 
    public string odatacontext 
    { 
     get; 
     set; 
    } 

    [JsonProperty("@odata.nextLink")] 
    public string odatanextLink 
    { 
     get; 
     set; 
    } 

    [JsonProperty("value")] 
    public IList<Value> value 
    { 
     get; 
     set; 
    } 
} 

次利用NewtonSoft図書館のようになります。この

var items = JsonConvert.DeserializeObject<Rootobject>(jsonstr); 

のように、私も

var sub = items.value[0].subject; 

更新出力

Have a look

を見るためにスクリーンショットを添付していますと、JSONオブジェクト項目の中から対象を抽出します。

+0

その解析自体は起こっていません。私は内部に配列を取得することができません。解析ロジックを助けてくれますか? – Apoorv

+0

@Apoorvわかりやすいスクリーンショットを添付しました。 –

+0

私の問題はアイテム内の値を取得する方法ですか?私は実際にそれらにアクセスする必要があります。私は質問を書いて物事を得るためにループを書くのに助けが必要です – Apoorv

関連する問題