Class RelationalCommandBuilderExtensions
- Namespace
- Microsoft.EntityFrameworkCore.Storage
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Extension methods for the IRelationalCommandBuilder class.
public static class RelationalCommandBuilderExtensions
- Inheritance
-
RelationalCommandBuilderExtensions
- Inherited Members
Remarks
See Implementation of database providers and extensions for more information and examples.
Methods
AddCompositeParameter(IRelationalCommandBuilder, string, IReadOnlyList<IRelationalParameter>)
Adds a parameter that is ultimately represented as multiple DbParameters in the final command.
public static IRelationalCommandBuilder AddCompositeParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, IReadOnlyList<IRelationalParameter> subParameters)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
invariantNamestringThe key that identifies this parameter. Note that IRelationalParameter just represents a placeholder for a parameter and not the actual value. This is because the same command can be reused multiple times with different parameter values.
subParametersIReadOnlyList<IRelationalParameter>The parameters to include in the composite.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
AddParameter(IRelationalCommandBuilder, string, string)
Adds a parameter.
[Obsolete("Use overload which takes TypeMapping argument.")]
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
invariantNamestringThe key that identifies this parameter. Note that IRelationalParameter just represents a placeholder for a parameter and not the actual value. This is because the same command can be reused multiple times with different parameter values.
namestringThe name to be used for the parameter when the command is executed against the database.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
AddParameter(IRelationalCommandBuilder, string, string, RelationalTypeMapping, bool?, ParameterDirection)
Adds a parameter.
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name, RelationalTypeMapping relationalTypeMapping, bool? nullable, ParameterDirection direction = ParameterDirection.Input)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
invariantNamestringThe key that identifies this parameter. Note that IRelationalParameter just represents a placeholder for a parameter and not the actual value. This is because the same command can be reused multiple times with different parameter values.
namestringThe name to be used for the parameter when the command is executed against the database.
relationalTypeMappingRelationalTypeMappingThe relational type mapping for this parameter.
nullablebool?A value indicating whether the parameter could contain a null value.
directionParameterDirectionThe parameter direction.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
AddRawParameter(IRelationalCommandBuilder, string, DbParameter)
Adds a parameter.
public static IRelationalCommandBuilder AddRawParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, DbParameter dbParameter)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
invariantNamestringThe key that identifies this parameter. Note that IRelationalParameter just represents a placeholder for a parameter and not the actual value. This is because the same command can be reused multiple times with different parameter values.
dbParameterDbParameterThe DbParameter being added.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
AppendLine(IRelationalCommandBuilder, string)
Appends an object to the command text on a new line.
public static IRelationalCommandBuilder AppendLine(this IRelationalCommandBuilder commandBuilder, string value)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
valuestringThe object to be written.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
AppendLines(IRelationalCommandBuilder, string, bool)
Appends an object, that contains multiple lines of text, to the command text. Each line read from the object is appended on a new line.
public static IRelationalCommandBuilder AppendLines(this IRelationalCommandBuilder commandBuilder, string value, bool skipFinalNewline = false)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
valuestringThe object to be written.
skipFinalNewlineboolIf true, then the final newline character is skipped.
Returns
- IRelationalCommandBuilder
The same builder instance so that multiple calls can be chained.
Indent(IRelationalCommandBuilder)
Increases the indent of the command text.
public static IDisposable Indent(this IRelationalCommandBuilder commandBuilder)
Parameters
commandBuilderIRelationalCommandBuilderThe command builder.
Returns
- IDisposable
The same builder instance so that multiple calls can be chained.