DbSet<TEntity>.AddRange Method

Definition

Overloads

AddRange(IEnumerable<TEntity>)

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(TEntity[])

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<TEntity>)

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<TEntity> entities);
abstract member AddRange : seq<'Entity (requires 'Entity : null)> -> unit
override this.AddRange : seq<'Entity (requires 'Entity : null)> -> unit
Public Overridable Sub AddRange (entities As IEnumerable(Of TEntity))

Parameters

entities
IEnumerable<TEntity>

The entities to add.

AddRange(TEntity[])

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 TEntity[] entities);
abstract member AddRange : 'Entity[] -> unit
override this.AddRange : 'Entity[] -> unit
Public Overridable Sub AddRange (ParamArray entities As TEntity())

Parameters

entities
TEntity[]

The entities to add.

Applies to