Shelby P. answered 09/19/20
Sr. FullStack Developer
So here is what I would do first follow the DRY Principal l would look it up.
Don't Repeat Yourself.
Then create two files :
AdvisoryHelper.cs
public class AdvisoryHelper
{
public float score { get; set; }
public int sources_active { get; set; }
public string message { get; set; }
public string updated { get; set; }
public string source { get; set; }
}
ContinentHelper.cs
public class ContinentHelper
{
public string iso_alpha2 { get; set; }
public string name { get; set; }
public string continent { get; set; }
}
Then modify each country class to look like this:
public class AD
{
public ContinentHelper continent { get; set; }
public AdvisoryHelper advisory { get; set; }
}
Then I would loop the data object pass each countryCode to the api?countrycode
something like this
then add the loop the json return and add the float to another list pass the list to ViewData and pass that to the view that should help.