Пример #1
0
        public static Driver GetEntity(this DriverPrimitive primitive)
        {
            Driver result = new Driver();

                result.Id = primitive.Id;

                result.Name = primitive.Name;

                result.Surname = primitive.Surname;

                result.Phone = primitive.Phone;

                result.InternalName = primitive.InternalName;

                result.Deleted = primitive.Deleted;

                result.Deactivated = primitive.Deactivated;

                return result;
        }
Пример #2
0
        private void FixupDriver(Driver previousValue)
        {
            if (previousValue != null && previousValue.Cars.Contains(this))
            {
                previousValue.Cars.Remove(this);
            }

            if (Driver != null)
            {
                if (!Driver.Cars.Contains(this))
                {
                    Driver.Cars.Add(this);
                }
                if (Driver_Id != Driver.Id)
                {
                    Driver_Id = Driver.Id;
                }
            }
            else if (!_settingFK)
            {
                Driver_Id = null;
            }
        }