Class StoredProcedureBuilder<TEntity>
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Provides a simple API for configuring a IMutableStoredProcedure that an entity type is mapped to.
public class StoredProcedureBuilder<TEntity> : StoredProcedureBuilder, IInfrastructure<EntityTypeBuilder>, IInfrastructure<IConventionStoredProcedureBuilder>, IInfrastructure<EntityTypeBuilder<TEntity>> where TEntity : class
Type Parameters
TEntity
The entity type being configured.
- Inheritance
-
StoredProcedureBuilder<TEntity>
- Implements
-
IInfrastructure<EntityTypeBuilder>IInfrastructure<IConventionStoredProcedureBuilder>IInfrastructure<EntityTypeBuilder<TEntity>>
- Inherited Members
Constructors
StoredProcedureBuilder(IMutableStoredProcedure, EntityTypeBuilder<TEntity>)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public StoredProcedureBuilder(IMutableStoredProcedure sproc, EntityTypeBuilder<TEntity> entityTypeBuilder)
Parameters
sproc
IMutableStoredProcedureentityTypeBuilder
EntityTypeBuilder<TEntity>
Methods
HasAnnotation(string, object?)
Adds or updates an annotation on the stored procedure. If an annotation with the key specified in
annotation
already exists, its value will be updated.
public virtual StoredProcedureBuilder<TEntity> HasAnnotation(string annotation, object? value)
Parameters
annotation
stringThe key of the annotation to be added or updated.
value
objectThe value to be stored in the annotation.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasOriginalValueParameter(string)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter(string propertyName)
Parameters
propertyName
stringThe property name.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasOriginalValueParameter(string, Action<StoredProcedureParameterBuilder>)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter(string propertyName, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyName
stringThe parameter name.
buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasOriginalValueParameter<TProperty>(Expression<Func<TEntity, TProperty>>)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasOriginalValueParameter<TProperty>(Expression<Func<TEntity, TProperty>>, Action<StoredProcedureParameterBuilder>)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasOriginalValueParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasOriginalValueParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>, Action<StoredProcedureParameterBuilder>)
Configures a new parameter that holds the original value if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasOriginalValueParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression, Action<StoredProcedureParameterBuilder> buildAction) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasParameter(string)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter(string propertyName)
Parameters
propertyName
stringThe property name.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasParameter(string, Action<StoredProcedureParameterBuilder>)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter(string propertyName, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyName
stringThe parameter name.
buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasParameter<TProperty>(Expression<Func<TEntity, TProperty>>)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasParameter<TProperty>(Expression<Func<TEntity, TProperty>>, Action<StoredProcedureParameterBuilder>)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>, Action<StoredProcedureParameterBuilder>)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder<TEntity> HasParameter<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression, Action<StoredProcedureParameterBuilder> buildAction) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasResultColumn(string)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn(string propertyName)
Parameters
propertyName
stringThe property name.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasResultColumn(string, Action<StoredProcedureResultColumnBuilder>)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn(string propertyName, Action<StoredProcedureResultColumnBuilder> buildAction)
Parameters
propertyName
stringThe property name.
buildAction
Action<StoredProcedureResultColumnBuilder>An action that performs configuration of the column.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasResultColumn<TProperty>(Expression<Func<TEntity, TProperty>>)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasResultColumn<TProperty>(Expression<Func<TEntity, TProperty>>, Action<StoredProcedureResultColumnBuilder>)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression, Action<StoredProcedureResultColumnBuilder> buildAction)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureResultColumnBuilder>An action that performs configuration of the column.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TProperty
HasResultColumn<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasResultColumn<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>, Action<StoredProcedureResultColumnBuilder>)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder<TEntity> HasResultColumn<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression, Action<StoredProcedureResultColumnBuilder> buildAction) where TDerivedEntity : class, TEntity
Parameters
propertyExpression
Expression<Func<TDerivedEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).buildAction
Action<StoredProcedureResultColumnBuilder>An action that performs configuration of the column.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
Type Parameters
TDerivedEntity
TProperty
HasRowsAffectedParameter()
Configures a new parameter that returns the rows affected if no such parameter exists.
public virtual StoredProcedureBuilder<TEntity> HasRowsAffectedParameter()
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasRowsAffectedParameter(Action<StoredProcedureParameterBuilder>)
Configures a new parameter that returns the rows affected if no such parameter exists.
public virtual StoredProcedureBuilder<TEntity> HasRowsAffectedParameter(Action<StoredProcedureParameterBuilder> buildAction)
Parameters
buildAction
Action<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasRowsAffectedResultColumn()
Configures a new column of the result that returns the rows affected for this stored procedure if no such column exists.
public virtual StoredProcedureBuilder<TEntity> HasRowsAffectedResultColumn()
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasRowsAffectedResultColumn(Action<StoredProcedureResultColumnBuilder>)
Configures a new column of the result that returns the rows affected for this stored procedure if no such column exists.
public virtual StoredProcedureBuilder<TEntity> HasRowsAffectedResultColumn(Action<StoredProcedureResultColumnBuilder> buildAction)
Parameters
buildAction
Action<StoredProcedureResultColumnBuilder>An action that performs configuration of the column.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.
HasRowsAffectedReturnValue(bool)
Configures the result of this stored procedure to be the number of rows affected.
public virtual StoredProcedureBuilder<TEntity> HasRowsAffectedReturnValue(bool rowsAffectedReturned = true)
Parameters
rowsAffectedReturned
boolA value indicating whether this stored procedure returns the number of rows affected.
Returns
- StoredProcedureBuilder<TEntity>
The same builder instance so that multiple configuration calls can be chained.