VkNet.Model.LongPollHistoryResponse.FromJson C# (CSharp) Method

FromJson() public static method

Разобрать из json.
public static FromJson ( VkResponse response ) : LongPollHistoryResponse
response VkNet.Utils.VkResponse Ответ сервера.
return LongPollHistoryResponse
        public static LongPollHistoryResponse FromJson(VkResponse response)
        {
            var fromJson = new LongPollHistoryResponse
            {
                UnreadMessages = response["messages"]["count"],
                Messages = response["messages"]["items"].ToReadOnlyCollectionOf<Message>(x => x),
                Profiles = response["profiles"].ToReadOnlyCollectionOf<User>(x => x),
                NewPts = response["new_pts"],
                More = response["more"]
            };
            VkResponseArray historys = response["history"];
            foreach (var history in historys)
            {
                VkResponseArray item = history;
                fromJson.History.Add(new ReadOnlyCollection<long>(item.ToReadOnlyCollectionOf<long>(x => x)));
            }
            return fromJson;
        }