v9.10.2019.0101  全面巩固批量Insert/Update/Upsert,支持数据备份、恢复和同步,支持实体列表保存到文件以及加载
大石头 authored at 2019-01-01 13:38:33
1.02 KiB
X
using System;

namespace NewLife.Data
{
    /// <summary>经纬度坐标</summary>
    public class GeoPoint
    {
        #region 属性
        /// <summary>经度</summary>
        public Double Longitude { get; set; }

        /// <summary>纬度</summary>
        public Double Latitude { get; set; }
        #endregion

        #region 构造
        /// <summary>经纬度坐标</summary>
        public GeoPoint() { }

        /// <summary>经纬度坐标</summary>
        /// <param name="location"></param>
        public GeoPoint(String location)
        {
            if (!location.IsNullOrEmpty())
            {
                var ss = location.Split(",");
                if (ss.Length >= 2)
                {
                    Longitude = ss[0].ToDouble();
                    Latitude = ss[1].ToDouble();
                }
            }
        }
        #endregion

        /// <summary>已重载</summary>
        /// <returns></returns>
        public override String ToString() => $"{Longitude},{Latitude}";
    }
}