public async Task <string> Index() { string url = "https://opentdb.com/api.php?amount=50&type=multiple&encode=url3986&difficulty=easy"; string json = await LlamarAPI(url); listado = JsonConvert.DeserializeObject <ApiCategoriaResult>(json); return("ok"); }
public async Task <string> Create() { string url = "https://opentdb.com/api.php?amount=50&type=multiple&encode=url3986&difficulty=easy"; string json = await LlamarAPI(url); listado = JsonConvert.DeserializeObject <ApiCategoriaResult>(json); //List<ViewModelABMCategoria> lista = listado.results.GroupBy(x => x.category).Select( a=> new ViewModelABMCategoria { Nombre = , cantidadPreguntas = listado.results.Where(p => p.category == x.category).Count() }).ToList(); return("ok"); }