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
ModificationCommandBatchFactoryDependenciesService dependencies.
Methods
Consume(RelationalDataReader)
Consumes the data reader created by Execute(IRelationalConnection).
protected override void Consume(RelationalDataReader reader)
Parameters
reader
RelationalDataReaderThe 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
RelationalDataReaderThe data reader.
cancellationToken
CancellationTokenA 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
intThe ordinal of the command being consumed.
reader
RelationalDataReaderThe 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
intThe ordinal of the command being consumed.
reader
RelationalDataReaderThe data reader.
cancellationToken
CancellationTokenA 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
intThe ordinal of the command being consumed.
reader
RelationalDataReaderThe 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
intThe ordinal of the command being consumed.
reader
RelationalDataReaderThe data reader.
cancellationToken
CancellationTokenA 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)