private void FixupUserRole(UserRole previousValue) { if (previousValue != null && ReferenceEquals(previousValue.RolePermission, this)) { previousValue.RolePermission = null; } if (UserRole != null) { UserRole.RolePermission = this; if (RolePermissionsID != UserRole.UserRoleID) { RolePermissionsID = UserRole.UserRoleID; } } }
private void FixupUserRole(UserRole previousValue) { if (previousValue != null && previousValue.Users.Contains(this)) { previousValue.Users.Remove(this); } if (UserRole != null) { if (!UserRole.Users.Contains(this)) { UserRole.Users.Add(this); } if (RoleID != UserRole.UserRoleID) { RoleID = UserRole.UserRoleID; } } }