Delen via


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

Source:
DbSet%60.cs
Source:
DbSet%60.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.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<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.

Remarks

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

Applies to

AddRange(TEntity[])

Source:
DbSet%60.cs
Source:
DbSet%60.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.cs
Source:
DbSet.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 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.

Remarks

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

Applies to