From 2d0bc8d0e628fa064d640c700c4e2296af6daaab Mon Sep 17 00:00:00 2001 From: itsokto <36706257+itsokto@users.noreply.github.com> Date: Sat, 30 May 2020 23:26:25 +0300 Subject: [PATCH] =?UTF-8?q?Price:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=BE=D0=BB=D0=B5=20old=5Famount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #995 --- VkNet/Model/Price.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/VkNet/Model/Price.cs b/VkNet/Model/Price.cs index 9442e710a..2b9d68ac5 100644 --- a/VkNet/Model/Price.cs +++ b/VkNet/Model/Price.cs @@ -1,4 +1,5 @@ using System; +using Newtonsoft.Json; using VkNet.Utils; namespace VkNet.Model @@ -12,16 +13,25 @@ public class Price /// /// Целочисленное значение цены, умноженное на 100. /// + [JsonProperty("amount")] public long? Amount { get; set; } /// /// Валюта. /// + [JsonProperty("currency")] public Currency Currency { get; set; } + /// + /// Старая цена товара в сотых долях единицы валюты. + /// + [JsonProperty("old_amount")] + public long? OldAmount { get; set; } + /// /// Строка с локализованной ценой и валютой. /// + [JsonProperty("text")] public string Text { get; set; } /// @@ -33,9 +43,10 @@ public static Price FromJson(VkResponse response) { var price = new Price { - Amount = response[key: "amount"] - , Currency = response[key: "currency"] - , Text = response[key: "text"] + Amount = response["amount"], + Currency = response["currency"], + OldAmount = response["old_amount"], + Text = response["text"] }; return price;