예제 #1
0
      public ActionResult Get()
      {
          ServiceFile service   = new ServiceFile();
          var         countries = service.GetFileData();

          return(Ok(countries));
      }
예제 #2
0
      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));
      }