public static WallGetObject FromJson(VkResponse response)
{
WallGetObject wallGetObject;
if (response.ContainsKey("items"))
{
wallGetObject = new WallGetObject
{
TotalCount = response["count"],
WallPosts = response["items"].ToReadOnlyCollectionOf<Post>(r => r),
Profiles = response["profiles"].ToReadOnlyCollectionOf<User>(r => r),
Groups = response["groups"].ToReadOnlyCollectionOf<Group>(r => r)
};
}
else
{
wallGetObject = new WallGetObject
{
WallPosts = response.ToReadOnlyCollectionOf<Post>(r => r)
};
}
return wallGetObject;
}