Table of Contents

Class AffectedCountModificationCommandBatch

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

A ReaderModificationCommandBatch for providers which append an SQL query to find out how many rows were affected (see AppendSelectAffectedCountCommand(StringBuilder, string, string, int)).

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

public abstract class AffectedCountModificationCommandBatch : ReaderModificationCommandBatch
Inheritance
AffectedCountModificationCommandBatch
Derived
Inherited Members

Constructors

AffectedCountModificationCommandBatch(ModificationCommandBatchFactoryDependencies)

Creates a new AffectedCountModificationCommandBatch instance.

protected AffectedCountModificationCommandBatch(ModificationCommandBatchFactoryDependencies dependencies)

Parameters

dependencies ModificationCommandBatchFactoryDependencies

Service dependencies.

Methods

Consume(RelationalDataReader)

Consumes the data reader created by Execute(IRelationalConnection).

protected override void Consume(RelationalDataReader reader)

Parameters

reader RelationalDataReader

The data reader.

ConsumeAsync(RelationalDataReader, CancellationToken)

Consumes the data reader created by ExecuteAsync(IRelationalConnection, CancellationToken).

protected override Task ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken = default)

Parameters

reader RelationalDataReader

The data reader.

cancellationToken CancellationToken

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

Returns

Task

A task that represents the asynchronous operation.

ConsumeResultSetWithPropagation(int, RelationalDataReader)

Consumes the data reader created by Execute(IRelationalConnection), propagating values back into the ModificationCommand.

protected virtual int ConsumeResultSetWithPropagation(int commandIndex, RelationalDataReader reader)

Parameters

commandIndex int

The ordinal of the command being consumed.

reader RelationalDataReader

The data reader.

Returns

int

The ordinal of the next command that must be consumed.

ConsumeResultSetWithPropagationAsync(int, RelationalDataReader, CancellationToken)

Consumes the data reader created by ExecuteAsync(IRelationalConnection, CancellationToken), propagating values back into the ModificationCommand.

protected virtual Task<int> ConsumeResultSetWithPropagationAsync(int commandIndex, RelationalDataReader reader, CancellationToken cancellationToken)

Parameters

commandIndex int

The ordinal of the command being consumed.

reader RelationalDataReader

The data reader.

cancellationToken CancellationToken

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

Returns

Task<int>

A task that represents the asynchronous operation. The task contains the ordinal of the next command that must be consumed.

ConsumeResultSetWithoutPropagation(int, RelationalDataReader)

Consumes the data reader created by Execute(IRelationalConnection) without propagating values back into the ModificationCommand.

protected virtual int ConsumeResultSetWithoutPropagation(int commandIndex, RelationalDataReader reader)

Parameters

commandIndex int

The ordinal of the command being consumed.

reader RelationalDataReader

The data reader.

Returns

int

The ordinal of the next command that must be consumed.

ConsumeResultSetWithoutPropagationAsync(int, RelationalDataReader, CancellationToken)

Consumes the data reader created by ExecuteAsync(IRelationalConnection, CancellationToken) without propagating values back into the ModificationCommand.

protected virtual Task<int> ConsumeResultSetWithoutPropagationAsync(int commandIndex, RelationalDataReader reader, CancellationToken cancellationToken)

Parameters

commandIndex int

The ordinal of the command being consumed.

reader RelationalDataReader

The data reader.

cancellationToken CancellationToken

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

Returns

Task<int>

A task that represents the asynchronous operation. The task contains the ordinal of the next command that must be consumed.

ThrowAggregateUpdateConcurrencyException(int, int, int)

Throws an exception indicating the command affected an unexpected number of rows.

protected virtual void ThrowAggregateUpdateConcurrencyException(int commandIndex, int expectedRowsAffected, int rowsAffected)

Parameters

commandIndex int

The ordinal of the command.

expectedRowsAffected int

The expected number of rows affected.

rowsAffected int

The actual number of rows affected.