public ActionResult Get() { ServiceFile service = new ServiceFile(); var countries = service.GetFileData(); return(Ok(countries)); }
public IActionResult GetCountry(string name) { ServiceFile service = new ServiceFile(); var result = service.GetFileData(); var cities = result.countries.FirstOrDefault(c => c.Country == name); if (cities == null) { return(NotFound()); } return(Ok(cities)); }