DbContext.AddRange Method
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.
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. |
- 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
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
- 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
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: