Пример #1
0
 protected override void ClearNavigationProperties()
 {
     base.ClearNavigationProperties();
     Employees.Clear();
     Manager      = null;
     EmployeeRole = null;
 }
Пример #2
0
        private void FixupEmployeeRole(EmployeeRole previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.Employees.Contains(this))
            {
                previousValue.Employees.Remove(this);
            }

            if (EmployeeRole != null)
            {
                if (!EmployeeRole.Employees.Contains(this))
                {
                    EmployeeRole.Employees.Add(this);
                }

                RoleId = EmployeeRole.Id;
            }
            else if (!skipKeys)
            {
                RoleId = null;
            }

            if (ChangeTracker.IsChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("EmployeeRole") &&
                    ReferenceEquals(ChangeTracker.OriginalValues["EmployeeRole"], EmployeeRole))
                {
                    //ChangeTracker.OriginalValues.Remove("EmployeeRole");
                }
                else
                {
                    //RecordOriginalValue("EmployeeRole", previousValue);
                }
                if (EmployeeRole != null && !EmployeeRole.ChangeTracker.IsChangeTrackingEnabled)
                {
                    EmployeeRole.StartTracking();
                }
            }
        }
Пример #3
0
 partial void EmployeeRoleChanged(EmployeeRole previousValue);
Пример #4
0
 partial void EmployeeRoleChanging(EmployeeRole newValue);