/// <summary> /// Разобрать из json. /// </summary> /// <param name="response">Ответ сервера.</param> /// <returns></returns> public static NewsItem FromJson(VkResponse response) { var newsItem = new NewsItem { Type = response["type"], SourceId = response["source_id"], Date = response["date"], PostId = response["post_id"], PostTypeOrder = response["post_type"], FinalPost = response["final_post"], CopyOwnerId = response["copy_owner_id"], CopyPostId = response["copy_post_id"], CopyHistory = response["copy_history"], CopyPostDate = response["copy_post_date"], Text = response["text"], CanEdit = response["can_edit"], CanDelete = response["can_delete"], Comments = response["comments"], Likes = response["likes"], Reposts = response["reposts"], Attachments = response["attachments"].ToReadOnlyCollectionOf<Attachment>(x => x), Geo = response["geo"], Photos = response["photos"].ToReadOnlyCollectionOf<Photo>(x => x), PhotoTags = response["photo_tags"], Notes = response["notes"].ToReadOnlyCollectionOf<Note>(x => x), Friends = response["friends"].ToReadOnlyCollectionOf<User>(x => x) }; return newsItem; }