コード例 #1
0
        public async Task <IEnumerable <string> > GetPhotoUrls(IRover rover, DateTime date)
        {
            if (rover == null)
            {
                return(Enumerable.Empty <string>());
            }

            var photos = await rover.GetPhotosAsync(date);

            if (photos == null)
            {
                return(Enumerable.Empty <string>());
            }

            return(photos.Select(p => p.Source)
                   .Where(s => !string.IsNullOrEmpty(s))
                   .ToList());
        }