In the Script folder, I created a subfolder called "js" where I stored a file named json containing an array of cities. I attempted to read this file from the folder and return a list to display in my select view.
{
"city": [
{ "Name": "Chicago" },
{ "Name": "New York" },
{ "Name": "Los Angeles" },
{ "Name": "Miami" },
{ "Name": "Dallas" },
{ "Name": "Seattle" },
{ "Name": "Boston" }
]
}
This is the structure of my classes:
public class City {
public string Name {
get;
set;
}
}
public class Cities {
public IList < City > cities {
get;
set;
}
}
Below is the action being executed:
public class CityAction {
public string GetName() {
// logic here
}
public List<string> GetAllCities() {
// logic here
}
}
An issue has been identified: