Goodnight. How to correctly implement a field check for null. I understand the vknet library and want to get a list of photos from the album with the best resolution. When requested, there comes a response with the available photo sizes. But each photo has its maximum size. How to sort incoming data correctly?
public static List<string> GetPhotoList(long ownerID, long albumID) { var photolist = new List<string>(); var photos = vk.Photo.Get(new PhotoGetParams { OwnerId = ownerID, AlbumId = PhotoAlbumType.Id(albumID) }); foreach (var photo in photos) { if (photo.Photo2560 != null) photolist.Add(photo.Photo2560.ToString()); if (photo.Photo1280 != null) photolist.Add(photo.Photo1280.ToString()); } return photolist; } I now have such a "bike" but it does not work as it should, it puts a bunch of duplicate links in a heap. If the photo has a field Photo2560 and Photo1280, then in my list both links are entered. I would like to get separate photos in the most affordable resolution that a particular photo has.