public static bool TryParse(string s, out GeoPoint result) { result = null; var parts = s.Split(','); if (parts.Length != 2) { return false; } double latitude, longitude; if (double.TryParse(parts[0], out latitude) && double.TryParse(parts[1], out longitude)) { result = new GeoPoint() { Longitude = longitude, Latitude = latitude }; return true; } return false; }
public IHttpActionResult Update(int id, GeoPoint location) { return Ok(new { id, location.Latitude, location.Longitude }); }
public IHttpActionResult Get(GeoPoint location) { return Ok(new { location.Latitude, location.Longitude }); }