IRelatedEnd.Attach Method

 

Attaches an entity to the related end.

Namespace:   System.Data.Entity.Core.Objects.DataClasses
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Attach(IEntityWithRelationships)

Attaches an entity to the related end. This method works in exactly the same way as Attach(object). It is maintained for backward compatibility with previous versions of IRelatedEnd.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Attach(Object)

Attaches an entity to the related end. If the related end is already filled or partially filled, this merges the existing entities with the given entity. The given entity is not assumed to be the complete set of related entities. Owner and all entities passed in must be in Unchanged or Modified state. Deleted elements are allowed only when the state manager is already tracking the relationship instance.


RelatedEnd.IRelatedEnd.Attach Method (IEntityWithRelationships)

Attaches an entity to the related end. This method works in exactly the same way as Attach(object). It is maintained for backward compatibility with previous versions of IRelatedEnd.

[SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
void IRelatedEnd.Attach(
	IEntityWithRelationships entity
)

Parameters

entity
Type: System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships

The entity to attach to the related end

Exception Condition
ArgumentNullException

Thrown when entity is null.

InvalidOperationException

Thrown when the entity cannot be related via the current relationship end.


RelatedEnd.IRelatedEnd.Attach Method (Object)

Attaches an entity to the related end. If the related end is already filled or partially filled, this merges the existing entities with the given entity. The given entity is not assumed to be the complete set of related entities. Owner and all entities passed in must be in Unchanged or Modified state. Deleted elements are allowed only when the state manager is already tracking the relationship instance.

[SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
void IRelatedEnd.Attach(
	object entity
)

Parameters

entity
Type: System.Object

The entity to attach to the related end

Exception Condition
ArgumentNullException

Thrown when entity is null.

InvalidOperationException

Thrown when the entity cannot be related via the current relationship end.