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
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
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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.
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name)Parameters
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- namestring
- The 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, IProperty)
Adds a parameter.
[Obsolete("Use overload with relationalTypeMapping")]
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name, IProperty property)Parameters
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- namestring
- The name to be used for the parameter when the command is executed against the database. 
- propertyIProperty
- The property that the type for this parameter will come from. 
Returns
- IRelationalCommandBuilder
- The same builder instance so that multiple calls can be chained. 
AddParameter(IRelationalCommandBuilder, string, string, RelationalTypeMapping, bool)
Adds a parameter.
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name, RelationalTypeMapping typeMapping, bool nullable)Parameters
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- namestring
- The name to be used for the parameter when the command is executed against the database. 
- typeMappingRelationalTypeMapping
- The type mapping for the property that values for this parameter will come from. 
- nullablebool
- A value indicating whether the parameter can contain null values. 
Returns
- IRelationalCommandBuilder
- The same builder instance so that multiple calls can be chained. 
AddParameter(IRelationalCommandBuilder, string, string, RelationalTypeMapping, bool?)
Adds a parameter.
public static IRelationalCommandBuilder AddParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name, RelationalTypeMapping relationalTypeMapping, bool? nullable)Parameters
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- namestring
- The name to be used for the parameter when the command is executed against the database. 
- relationalTypeMappingRelationalTypeMapping
- The relational type mapping for this parameter. 
- nullablebool?
- A value indicating whether the parameter could contain a null value. 
Returns
- IRelationalCommandBuilder
- The same builder instance so that multiple calls can be chained. 
AddPropertyParameter(IRelationalCommandBuilder, string, string, IProperty)
Adds a parameter.
[Obsolete("Use overload with relationalTypeMapping")]
public static IRelationalCommandBuilder AddPropertyParameter(this IRelationalCommandBuilder commandBuilder, string invariantName, string name, IProperty property)Parameters
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- namestring
- The name to be used for the parameter when the command is executed against the database. 
- propertyIProperty
- The property that values for this parameter will come from. 
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
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- invariantNamestring
- The 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. 
- dbParameterDbParameter
- The 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
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- valuestring
- The 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
- commandBuilderIRelationalCommandBuilder
- The command builder. 
- valuestring
- The object to be written. 
- skipFinalNewlinebool
- If 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
- commandBuilderIRelationalCommandBuilder
- The command builder. 
Returns
- IDisposable
- The same builder instance so that multiple calls can be chained.