Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectContext::Attach Method (IEntityWithKey^)

Entity Framework 6.0
 

Attaches an object or object graph to the object context when the object has an entity key.

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

public:
virtual void Attach(
	IEntityWithKey^ entity
)

Parameters

entity
Type: System.Data.Entity.Core.Objects.DataClasses::IEntityWithKey^

The object to attach.

Exception Condition
ArgumentNullException

The entity is null.

InvalidOperationException

Invalid entity key.

Return to top
Show: