private async Task <List <Cats> > GetCat() { List <Cats> result = null; ApiConfigCats apiCats = new ApiConfigCats() { Params = new Params() { Size = "full", MimeType = "jpg", Format = "json", HasBreeds = false, //array vazio com ele true Order = "RANDOM", Page = 0, Limit = 25 } }; //Metodo para montar a url com parametros string url = apiCats.GetUrlParams(apiCats.Params); CatsService service = new CatsService(); result = await service.Get(url); return(result); }
[HttpGet] //NOTE this route is 'api/cats' public ActionResult <IEnumerable <Cat> > GetAll() { try { return(Ok(_cs.Get())); } catch (Exception e) { return(BadRequest(e.Message)); } }