示例#1
0
        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;
        }
示例#2
0
 public IHttpActionResult Update(int id, GeoPoint location)
 {
     return Ok(new { id, location.Latitude, location.Longitude });
 }
示例#3
0
 public IHttpActionResult Get(GeoPoint location)
 {
     return Ok(new { location.Latitude, location.Longitude });
 }