Interface IUpdateSqlGenerator
- Namespace
- Microsoft.EntityFrameworkCore.Update
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A service used to generate SQL for insert, update, and delete commands, and related SQL operations needed for Microsoft.EntityFrameworkCore.DbContext.SaveChanges
This type is typically used by database providers; it is generally not used in application code.
The service lifetime is Singleton. This means a single instance is used by many Microsoft.EntityFrameworkCore.DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.
public interface IUpdateSqlGenerator
Methods
AppendBatchHeader(StringBuilder)
Appends a SQL fragment for the start of a batch to the full command being built by the given StringBuilder.
void AppendBatchHeader(StringBuilder commandStringBuilder)
Parameters
commandStringBuilder
StringBuilderThe builder to which the SQL fragment should be appended.
AppendDeleteOperation(StringBuilder, ModificationCommand, int)
Appends a SQL command for deleting a row to the commands being built.
ResultSetMapping AppendDeleteOperation(StringBuilder commandStringBuilder, ModificationCommand command, int commandPosition)
Parameters
commandStringBuilder
StringBuilderThe builder to which the SQL should be appended.
command
ModificationCommandThe command that represents the delete operation.
commandPosition
intThe ordinal of this command in the batch.
Returns
- ResultSetMapping
The ResultSetMapping for the command.
AppendInsertOperation(StringBuilder, ModificationCommand, int)
Appends a SQL command for inserting a row to the commands being built.
ResultSetMapping AppendInsertOperation(StringBuilder commandStringBuilder, ModificationCommand command, int commandPosition)
Parameters
commandStringBuilder
StringBuilderThe builder to which the SQL should be appended.
command
ModificationCommandThe command that represents the delete operation.
commandPosition
intThe ordinal of this command in the batch.
Returns
- ResultSetMapping
The ResultSetMapping for the command.
AppendNextSequenceValueOperation(StringBuilder, string, string)
Generates a SQL fragment that will get the next value from the given sequence and appends it to the full command being built by the given StringBuilder.
void AppendNextSequenceValueOperation(StringBuilder commandStringBuilder, string name, string schema)
Parameters
commandStringBuilder
StringBuilderThe builder to which the SQL fragment should be appended.
name
stringThe name of the sequence.
schema
stringThe schema that contains the sequence, or null to use the default schema.
AppendUpdateOperation(StringBuilder, ModificationCommand, int)
Appends a SQL command for updating a row to the commands being built.
ResultSetMapping AppendUpdateOperation(StringBuilder commandStringBuilder, ModificationCommand command, int commandPosition)
Parameters
commandStringBuilder
StringBuilderThe builder to which the SQL should be appended.
command
ModificationCommandThe command that represents the delete operation.
commandPosition
intThe ordinal of this command in the batch.
Returns
- ResultSetMapping
The ResultSetMapping for the command.
GenerateNextSequenceValueOperation(string, string)
Generates SQL that will obtain the next value in the given sequence.
string GenerateNextSequenceValueOperation(string name, string schema)
Parameters
name
stringThe name of the sequence.
schema
stringThe schema that contains the sequence, or null to use the default schema.
Returns
- string
The SQL.