Table of Contents

Class ModificationCommandBatch

Namespace
Microsoft.EntityFrameworkCore.Update
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

A base class for a collection of ModificationCommands that can be executed as a batch.

This type is typically used by database providers; it is generally not used in application code.

public abstract class ModificationCommandBatch
Inheritance
ModificationCommandBatch
Derived
Inherited Members

Constructors

ModificationCommandBatch()

protected ModificationCommandBatch()

Properties

ModificationCommands

The list of conceptual insert/update/delete ModificationCommandss in the batch.

public abstract IReadOnlyList<ModificationCommand> ModificationCommands { get; }

Property Value

IReadOnlyList<ModificationCommand>

Methods

AddCommand(ModificationCommand)

Adds the given insert/update/delete ModificationCommands to the batch.

public abstract bool AddCommand(ModificationCommand modificationCommand)

Parameters

modificationCommand ModificationCommand

The command to add.

Returns

bool

true if the command was successfully added; false if there was no room in the current batch to add the command and it must instead be added to a new batch.

Execute(IRelationalConnection)

Sends insert/update/delete commands to the database.

public abstract void Execute(IRelationalConnection connection)

Parameters

connection IRelationalConnection

The database connection to use.

ExecuteAsync(IRelationalConnection, CancellationToken)

Sends insert/update/delete commands to the database.

public abstract Task ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken = default)

Parameters

connection IRelationalConnection

The database connection to use.

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task

A task that represents the asynchronous save operation.