src/Shared/EntityFramework/Core/Objects/DataClasses/ComplexObject.cs
// <summary>
// Associate the ComplexType with an Entity or another ComplexObject
// Parent may be an Entity or ComplexObject
// </summary>
// <param name="parent"> Object to be added to. </param>
// <param name="parentPropertyName"> The property on the parent that reference the complex type. </param>
Associate the ComplexType with an Entity or another ComplexObject
Parent may be an Entity or ComplexObject
Associate the ComplexType with an Entity or another ComplexObject Parent may be an Entity or ComplexObject
internal void AttachToParent(
            StructuralObject parent,
            string parentPropertyName)
        {
            DebugCheck.NotNull(parent);
            DebugCheck.NotNull(parentPropertyName);
            if (_parent != null)
            {
                throw new InvalidOperationException(Strings.ComplexObject_ComplexObjectAlreadyAttachedToParent);
            }
            Debug.Assert(_parentPropertyName == null);
            _parent = parent;
            _parentPropertyName = parentPropertyName;
        }
internal void AttachToParent ( StructuralObject parent , string parentPropertyName ) { DebugCheck . NotNull ( parent ) ; DebugCheck . NotNull ( parentPropertyName ) ; if ( _parent != null ) { throw new InvalidOperationException ( Strings . ComplexObject_ComplexObjectAlreadyAttachedToParent ) ; } Debug . Assert ( _parentPropertyName == null ) ; _parent = parent ; _parentPropertyName = parentPropertyName ; }
Associate the ComplexType with an Entity or another ComplexObject
Parent may be an Entity or ComplexObject
Associate the ComplexType with an Entity or another ComplexObject Parent may be an Entity or ComplexObject
parent
StructuralObject
Object to be added to.
Object to be added to .
parentPropertyName
string
The property on the parent that reference the complex type.
The property on the parent that reference the complex type .