Esempio n. 1
0
        public static async Task <BreedImage> GetBreedImages()
        {
            var client = CatAPIMethods.GetHttpClient();

            var response = await client.GetAsync("v1/images/search?breed_ids=beng");

            var catImages = await response.Content.ReadAsAsync <List <BreedImage> >();

            return(catImages[0]);
        }
Esempio n. 2
0
        public IActionResult RandomCatByBreed()
        {
            var catImages = CatAPIMethods.GetBreedImages().Result;

            return(View(catImages));
        }
Esempio n. 3
0
        public IActionResult Index()
        {
            var catBreeds = CatAPIMethods.CatBreeds().Result;

            return(View(catBreeds));
        }