Share via


DbContext.AddRange Method

Definition

Overloads

AddRange(IEnumerable<Object>)

Begins tracking the given entities, and any other reachable entities that are not already being tracked, in the Added state such that they will be inserted into the database when SaveChanges() is called.

AddRange(Object[])

Begins tracking the given entities, and any other reachable entities that are not already being tracked, in the Added state such that they will be inserted into the database when SaveChanges() is called.

AddRange(IEnumerable<Object>)

Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs

Begins tracking the given entities, and any other reachable entities that are not already being tracked, in the Added state such that they will be inserted into the database when SaveChanges() is called.

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

Parameters

entities
IEnumerable<Object>

The entities to add.

Remarks

See EF Core change tracking and Using AddRange, UpdateRange, AttachRange, and RemoveRange for more information and examples.

Applies to

AddRange(Object[])

Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs
Source:
DbContext.cs

Begins tracking the given entities, and any other reachable entities that are not already being tracked, in the Added state such that they will be inserted into the database when SaveChanges() is called.

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

Parameters

entities
Object[]

The entities to add.

Remarks

See EF Core change tracking and Using AddRange, UpdateRange, AttachRange, and RemoveRange for more information and examples.

Applies to