Q:

How to loop through json array that lookes like this.  Using C# and Facebook graph api

Im trying to get events from facebook with multiple ids.  I works with one ID, but the problem is when im trying to work with multiple ids.  I have problem with the json result that i get.  The result doesent start with "data" and i cant find help for my issue when its start with the id. Pasting my Json result and C# code here.  Thnx. 
Json result {
    = { {
        "167730163274461": {
            "data": [
            {
                "description": "",
                "end_time": "2017-05-13T23:00:00+0200",
                "name": "Tjuvjakt (SE) LIVE på Babel",
                "place": {
                    "name": "Babel Malmö",
                    "location": {
                        "city": "Malmö",
                        "country": "Sweden",
                        "latitude": 55.596131504101,
                        "longitude": 13.010933324378,
                        "street": "Spångatan 38",
                        "zip": "211 53"
                    },
                    "id": "167730163274461"
                },
                "start_time": "2017-05-13T19:30:00+0200",
                "id": "1188647557883179"
            },

            "157257114335823": {
                "data": [
                {
                    "description": "",
                    "end_time": "2017-05-21T03:00:00+0200",
                    "name": "Morrissey / The Smiths - Unhappy Birthday Party",
                    "place": {
                        "name": "Moriska Paviljongen",
                        "location": {
                            "city": "Malmö",
                            "country": "Sweden",
                            "latitude": 55.593787653743,
                            "longitude": 13.013644627863,
                            "street": "Norra Parkgatan 2",
                            "zip": "21422"
                        },
                        "id": "157257114335823"
                    },
                    "start_time": "2017-05-20T23:00:00+0200",
                    "id": "1208509892563996"
                },
            }

            List<FbEvents> listOfEvents;
            public ActionResult Index()
            {
                WebClient myWebClient = new WebClient();

                string downloadUrl = "https://graph.facebook.com/events?ids=167730163274461,157257114335823&access_token=**=40";

                Uri downloadUri = new Uri(downloadUrl, UriKind. Absolute);
                string downloadedJsonResult = null;

                try
                {
                    downloadedJsonResult = myWebClient. DownloadString(downloadUri);

                }

                catch (Exception ex)
                {
                    ViewBag. ErrorMessage = ex. ToString();
                    return View("Error");
                }

                JObject jsoncreatestring = JObject. Parse(downloadedJsonResult);

                JArray requiredDataArray = (JArray)jsoncreatestring["167730163274461"]["data"];
                string stringToBe = requiredDataArray. ToString();
                listOfEvents = JsonConvert. DeserializeObject<List<FbEvents>>(stringToBe);

                return View(listOfEvents);
            }
        }
    }

    public class FbEvents
    {
        [JsonProperty("owner")]
        public string owner { get; set; }

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

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

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

        [JsonProperty("cover")]
        public Dictionary<string, string> cover { get; set; }

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

A:

I don't think it's the best way to do it but it should work like this:
// [...]

JObject jsoncreatestring = JObject. Parse(downloadedJsonResult);

List<FbEvents> listOfEvents = new List<FbEvents>();

foreach (var item in jsoncreatestring)
{
    JArray requiredDataArray = (JArray)item. Value["data"];
    FbEvents fbEvent = JsonConvert. DeserializeObject<List<FbEvents>>(requiredDataArray. ToString())[0];

    listOfEvents. Add(fbEvent);
}

return View(listOfEvents);

// [...]

