internal RelationshipEntry( ObjectStateManager cache, EntityState state, RelationshipWrapper relationshipWrapper) : base(cache, (EntitySet)null, state) { this._entitySet = (EntitySetBase)relationshipWrapper.AssociationSet; this._relationshipWrapper = relationshipWrapper; }
internal RelationshipEntry(ObjectStateManager cache, EntityState state, RelationshipWrapper relationshipWrapper) : base(cache, null, state) { DebugCheck.NotNull(relationshipWrapper); Debug.Assert( EntityState.Added == state || EntityState.Unchanged == state || EntityState.Deleted == state, "invalid EntityState"); base._entitySet = relationshipWrapper.AssociationSet; _relationshipWrapper = relationshipWrapper; }
internal void ChangeRelatedEnd(EntityKey oldKey, EntityKey newKey) { if (oldKey.Equals(this.Key0)) { if (oldKey.Equals(this.Key1)) { this.RelationshipWrapper = new RelationshipWrapper(this.RelationshipWrapper.AssociationSet, newKey); } else { this.RelationshipWrapper = new RelationshipWrapper(this.RelationshipWrapper, 0, newKey); } } else { this.RelationshipWrapper = new RelationshipWrapper(this.RelationshipWrapper, 1, newKey); } }
// <summary> // Update one of the ends of the relationship // </summary> internal void ChangeRelatedEnd(EntityKey oldKey, EntityKey newKey) { if (oldKey.Equals(Key0)) { if (oldKey.Equals(Key1)) { // self-reference RelationshipWrapper = new RelationshipWrapper(RelationshipWrapper.AssociationSet, newKey); } else { RelationshipWrapper = new RelationshipWrapper(RelationshipWrapper, 0, newKey); } } else { RelationshipWrapper = new RelationshipWrapper(RelationshipWrapper, 1, newKey); } }
internal override void Reset() { this._relationshipWrapper = (RelationshipWrapper)null; base.Reset(); }
internal override void Reset() { _relationshipWrapper = null; base.Reset(); }