private void QueryCounty(Dictionary <string, object> source, MeningoPatient patient) { if (!QueryCountyEnabled) { return; } var json = new GeonamesService().QueryByPostalCode(source["plz"].ToString()); var jObject = JObject.Parse(json); var postalCodes = jObject["postalcodes"]; if (postalCodes.Any()) { var city = postalCodes[0]["placeName"]; var county = postalCodes[0]["adminName3"]; var state = postalCodes[0]["adminCode1"]; patient.County = county.ToString(); } }
public GeonamesController(GeonamesService geonamesService, Func <string, string> readServerFile) { _geonamesService = geonamesService; this.readServerFile = readServerFile; }