public string GetPhotoUrl()
{
var posts = Api.Wall.Get(new WallGetParams { Domain = "some_domain", Count = 2 });
foreach (var item in posts.WallPosts)
{
string phUrl = (item.Attachments[0].Instance as Photo).Sizes[0].Url.AbsoluteUri.ToString();
MessageBox.Show(phUrl);
}
return "";
}
public IEnumerable<string> GetPhotoUrl() =>
Api
.Wall
.Get(new WallGetParams
{
Domain = "lol.community",
Count = 2
})
.WallPosts
.Select(item => item.Attachments.FirstOfDefault()?.Instance)
.OfType<Photo>()
.Select(item => item.Sizes.FirstOfDefault()?.Url.AbsoluteUrl.ToString());