Amy S.

asked • 08/02/20

URGENT! Can't show data using API with C# ASP.NET Core

I am using a Travel Advisory API but am unable to show all the data. Each country is a separate key and form different classes when I paste the JSON as classes.

How can I call each country class (eg. AU) and display the data under the country using a loop?



Basic API Endpoint: https://www.travel-advisory.info/api

Optional Parameter: https://www.travel-advisory.info/api?countrycode=AU

(restrict the result list to a single country)


My Code:

Model: https://controlc.com/da48a2be

Controller: https://controlc.com/51d938c7

1 Expert Answer

By:

Shelby P. answered • 09/19/20

Tutor
New to Wyzant

Sr. FullStack Developer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.