/// <summary> /// Разобрать из json. /// </summary> /// <param name="response">Ответ сервера.</param> /// <returns></returns> internal static NewsUserListItem FromJson(VkResponse response) { var newsUserListItem = new NewsUserListItem { Id = response["id"], Title = response["title"], NoReposts = response["no_reposts"] }; VkResponseArray sourceIds = response["source_ids"]; if (sourceIds.Count == 0) { newsUserListItem.SourceIds = new List<long>(); } else { newsUserListItem.SourceIds = sourceIds.ToReadOnlyCollectionOf<long>(x => x); } return newsUserListItem; }
/// <summary> /// Разобрать из json. /// </summary> /// <param name="response">Ответ сервера.</param> /// <returns></returns> public static NewsUserListItem FromJson(VkResponse response) { var newsUserListItem = new NewsUserListItem { Id = response["id"], Title = response["title"], NoReposts = response["no_reposts"] }; VkResponseArray sourceIds = response["source_ids"]; if (sourceIds.Count == 0) { newsUserListItem.SourceIds = new List <long>(); } else { newsUserListItem.SourceIds = sourceIds.ToReadOnlyCollectionOf <long>(x => x); } return(newsUserListItem); }