Facebook.Profile DeserializeProfile(string json) { Facebook.Profile profile = new Facebook.Profile(); JSONNode root = JSON.Parse(json); profile.Id = root["id"]; profile.FirstName = root["first_name"]; profile.LastName = root["last_name"]; return profile; }
List<Facebook.Profile> DeserializeFriendProfiles(string json) { List<Facebook.Profile> friends = new List<Facebook.Profile>(); JSONNode root = JSON.Parse(json); JSONNode data = root["friends"]["data"]; for (int i = 0; i < data.Count; i++) { Facebook.Profile profile = new Facebook.Profile(); profile.Id = data[i]["id"]; profile.FirstName = data[i]["first_name"]; profile.LastName = data[i]["last_name"]; friends.Add(profile); } return friends; }