コード例 #1
0
        internal static UserProfilePhotosResponse Parse(dynamic data)
        {
            if (data == null || data.total_count == null || data.photos == null)
            {
                return null;
            }

            var userProfilePhotosResponse = new UserProfilePhotosResponse
            {
                TotalCount = data.total_count
            };

            foreach (var photo in data.photos)
            {
                userProfilePhotosResponse.Photos.Add(PhotoSizeResponse.Parse(photo));
            }

            return userProfilePhotosResponse;
        }
コード例 #2
0
        internal static UserProfilePhotosResponse Parse(JsonData data)
        {
            if (data == null || !data.Has("total_count") || !data.Has("photos"))
            {
                return(null);
            }

            var userProfilePhotosResponse = new UserProfilePhotosResponse
            {
                TotalCount = data.Get <int>("total_count")
            };

            foreach (var photo in data.GetJsonList("photo"))
            {
                userProfilePhotosResponse.Photos.Add(PhotoSizeResponse.Parse(photo));
            }

            return(userProfilePhotosResponse);
        }