DbContext.AttachRange DbContext.AttachRange DbContext.AttachRange Method

Definition

Overloads

AttachRange(IEnumerable<Object>) AttachRange(IEnumerable<Object>) AttachRange(IEnumerable<Object>)

Begins tracking the given entities in the Unchanged state such that no operation will be performed when SaveChanges() is called.

A recursive search of the navigation properties will be performed to find reachable entities that are not already being tracked by the context. These entities will also begin to be tracked by the context. If a reachable entity has its primary key value set then it will be tracked in the Unchanged state. If the primary key value is not set then it will be tracked in the Added state. An entity is considered to have its primary key value set if the primary key property is set to anything other than the CLR default for the property type.

AttachRange(Object[]) AttachRange(Object[]) AttachRange(Object[])

Begins tracking the given entities in the Unchanged state such that no operation will be performed when SaveChanges() is called.

A recursive search of the navigation properties will be performed to find reachable entities that are not already being tracked by the context. These entities will also begin to be tracked by the context. If a reachable entity has its primary key value set then it will be tracked in the Unchanged state. If the primary key value is not set then it will be tracked in the Added state. An entity is considered to have its primary key value set if the primary key property is set to anything other than the CLR default for the property type.

AttachRange(IEnumerable<Object>) AttachRange(IEnumerable<Object>) AttachRange(IEnumerable<Object>)

Begins tracking the given entities in the Unchanged state such that no operation will be performed when SaveChanges() is called.

A recursive search of the navigation properties will be performed to find reachable entities that are not already being tracked by the context. These entities will also begin to be tracked by the context. If a reachable entity has its primary key value set then it will be tracked in the Unchanged state. If the primary key value is not set then it will be tracked in the Added state. An entity is considered to have its primary key value set if the primary key property is set to anything other than the CLR default for the property type.

public virtual void AttachRange (System.Collections.Generic.IEnumerable<object> entities);
abstract member AttachRange : seq<obj> -> unit
override this.AttachRange : seq<obj> -> unit
Public Overridable Sub AttachRange (entities As IEnumerable(Of Object))

Parameters

entities
IEnumerable<Object>

The entities to attach.

AttachRange(Object[]) AttachRange(Object[]) AttachRange(Object[])

Begins tracking the given entities in the Unchanged state such that no operation will be performed when SaveChanges() is called.

A recursive search of the navigation properties will be performed to find reachable entities that are not already being tracked by the context. These entities will also begin to be tracked by the context. If a reachable entity has its primary key value set then it will be tracked in the Unchanged state. If the primary key value is not set then it will be tracked in the Added state. An entity is considered to have its primary key value set if the primary key property is set to anything other than the CLR default for the property type.

public virtual void AttachRange (params object[] entities);
abstract member AttachRange : obj[] -> unit
override this.AttachRange : obj[] -> unit
Public Overridable Sub AttachRange (ParamArray entities As Object())

Parameters

entities
Object[]

The entities to attach.

Applies to