public IObjectConverter <InstaFriendshipShortStatusList, InstaFriendshipShortStatusListResponse> GetFriendshipShortStatusListConverter( InstaFriendshipShortStatusListResponse response) { return(new InstaFriendshipShortStatusListConverter { SourceObject = response }); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var root = JToken.Load(reader); var statusSubContainer = root["friendship_statuses"]; var list = new InstaFriendshipShortStatusListResponse(); var extras = statusSubContainer.ToObject <InstaExtraResponse>(); if (extras != null && extras.Extras != null && extras.Extras.Any()) { foreach (var item in extras.Extras) { try { var f = item.Value.ToObject <InstaFriendshipShortStatusResponse>(); f.Pk = long.Parse(item.Key); list.Add(f); } catch { } } } return(list); }