ObjectContext.Attach Method (IEntityWithKey)
Attaches an object or object graph to the object context when the object has an entity key.
Assembly: EntityFramework (in EntityFramework.dll)
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. |