public void Add(LocationMessage locationMessage)
        {
            try
            {
                Location location = new Location();
                location.CoordinateTypeID = locationMessage.CoordinateType.GetHashCode();
                location.DeviceID = locationMessage.DeviceID;
                location.Direction = locationMessage.Direction;
                location.EngineTemperature = locationMessage.EngineTemperature;
                location.GpsSpeed = locationMessage.GpsSpeed;
                location.GpsTime = locationMessage.GpsTime;
                location.GpsLatitude = locationMessage.Latitude;
                location.GpsLongitude = locationMessage.Longitude;
                location.ObdSpeed = locationMessage.ObdSpeed;
                location.SatelliteNum = locationMessage.SatelliteNum;

                BaiduCoordinate baiduCoord = ConvertCoordinate(new GpsCoordinate { Latitude = locationMessage.Latitude, Longitude = locationMessage.Longitude });
                location.BaiduLatitude = baiduCoord.Latitude;
                location.BaiduLongitude = baiduCoord.Longitude;

                dataContext.Location.InsertOnSubmit(location);
                dataContext.SubmitChanges();

            }
            catch (Exception ex)
            {
                log.Error("Exception", ex);
            }
        }
		private void detach_Location(Location entity)
		{
			this.SendPropertyChanging();
			entity.DeviceInfo = null;
		}
 partial void DeleteLocation(Location instance);
 partial void UpdateLocation(Location instance);
		private void detach_Location(Location entity)
		{
			this.SendPropertyChanging();
			entity.CoordinateType = null;
		}
 partial void InsertLocation(Location instance);