コード例 #1
0
        internal RelationshipEntry(ObjectStateManager cache, EntityState state, RelationshipWrapper relationshipWrapper)
            : base(cache, null, state)
        {
            Debug.Assert(null != relationshipWrapper, "null RelationshipWrapper");
            Debug.Assert(EntityState.Added == state ||
                         EntityState.Unchanged == state ||
                         EntityState.Deleted == state,
                         "invalid EntityState");

            base._entitySet      = relationshipWrapper.AssociationSet;
            _relationshipWrapper = relationshipWrapper;
        }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
        override internal void Reset()
        {
            _relationshipWrapper = null;

            base.Reset();
        }