ObjectContext.Attach(IEntityWithKey) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attaches an object or object graph to the object context when the object has an entity key.
public virtual void Attach (System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey entity);
abstract member Attach : System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey -> unit
override this.Attach : System.Data.Entity.Core.Objects.DataClasses.IEntityWithKey -> unit
Public Overridable Sub Attach (entity As IEntityWithKey)
Parameters
- entity
- IEntityWithKey
The object to attach.
Exceptions
The entity is null.
Invalid entity key.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework