Esempio n. 1
0
        public static Car GetEntity(this CarPrimitive primitive)
        {
            Car result = new Car();

                result.Id = primitive.Id;

                result.RegistrationNumber = primitive.RegistrationNumber;

                result.Name = primitive.Name;

                result.InternalName = primitive.InternalName;

                result.CarType = primitive.CarType;

                result.Deleted = primitive.Deleted;

                result.Capacity = primitive.Capacity;

                result.TransportType = primitive.TransportType;

                result.Driver_Id = primitive.Driver_Id;

                result.Deactivated = primitive.Deactivated;

                return result;
        }
Esempio n. 2
0
        private void FixupCar(Car previousValue)
        {
            if (previousValue != null && ReferenceEquals(previousValue.CarType, this))
            {
                previousValue.CarType = null;
            }

            if (Car != null)
            {
                Car.CarType = this;
                if (Id != Car.Id)
                {
                    Id = Car.Id;
                }
            }
        }
Esempio n. 3
0
        private void FixupCar(Car previousValue)
        {
            if (previousValue != null && previousValue.DeliveryNotes.Contains(this))
            {
                previousValue.DeliveryNotes.Remove(this);
            }

            if (Car != null)
            {
                if (!Car.DeliveryNotes.Contains(this))
                {
                    Car.DeliveryNotes.Add(this);
                }
                if (Car_Id != Car.Id)
                {
                    Car_Id = Car.Id;
                }
            }
            else if (!_settingFK)
            {
                Car_Id = null;
            }
        }