コード例 #1
0
        public JsonResult Release(string search)
        {
            var apiWrapper = new ApiWrapper();
            var response = new ApiResponse();

            int id = -1;
            if (int.TryParse(search, out id))
                response = apiWrapper.TryGet(string.Format("/release/details?releaseid={0}&imageSize=200", id));
            else
                response = apiWrapper.TryGet(string.Format("/release/search?q={0}&imageSize=200", search));

            var images = GetImages(response);

            return Json(images, JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
        private IEnumerable<string> GetImages(ApiResponse response)
        {
            var images = response.Xml.Descendants("image").Select(i => i.Value);

            return images;
        }