public static Market FromJson(VkResponse response)
{
var result = new Market
{
Id = response["id"] ?? -1,
OwnerId = response["owner_id"],
Title = response["title"],
Description = response["description"],
Price = response["price"],
MarketCategory = response["category"],
ThumbPhoto = response["thumb_photo"],
Date = response["date"],
Availability = response["availability"],
Photos = response["photos"].ToReadOnlyCollectionOf<Photo>(x => x),
CanComment = response["can_comment"],
CanRepost = response["can_repost"],
Likes = response["likes"]
};
return result;
}