Example #1
0
     private void FixupVehicleType(VehicleType previousValue)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (VehicleType != null)
         {
             VehicleTypeId = VehicleType.Id;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("VehicleType")
                 && (ChangeTracker.OriginalValues["VehicleType"] == VehicleType))
             {
                 ChangeTracker.OriginalValues.Remove("VehicleType");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("VehicleType", previousValue);
             }
             if (VehicleType != null && !VehicleType.ChangeTracker.ChangeTrackingEnabled)
             {
                 VehicleType.StartTracking();
             }
         }
     }
Example #2
0
     public bool Equals(VehicleType other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }