Class StoredProcedureBuilder
- 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 : IInfrastructure<EntityTypeBuilder>, IInfrastructure<IConventionStoredProcedureBuilder>
- Inheritance
-
StoredProcedureBuilder
- Implements
-
IInfrastructure<EntityTypeBuilder>IInfrastructure<IConventionStoredProcedureBuilder>
- Derived
- Inherited Members
Constructors
StoredProcedureBuilder(IMutableStoredProcedure, EntityTypeBuilder)
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 entityTypeBuilder)
Parameters
sprocIMutableStoredProcedureentityTypeBuilderEntityTypeBuilder
Properties
Builder
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.
protected virtual InternalStoredProcedureBuilder Builder { get; }
Property Value
Metadata
The stored procedure being configured.
public virtual IMutableStoredProcedure Metadata { get; }
Property Value
Methods
CreatePropertyBuilder(string)
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.
protected virtual PropertyBuilder CreatePropertyBuilder(string propertyName)
Parameters
propertyNamestring
Returns
- PropertyBuilder
CreatePropertyBuilder<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>>)
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.
protected virtual PropertyBuilder CreatePropertyBuilder<TDerivedEntity, TProperty>(Expression<Func<TDerivedEntity, TProperty>> propertyExpression) where TDerivedEntity : class
Parameters
propertyExpressionExpression<Func<TDerivedEntity, TProperty>>
Returns
- PropertyBuilder
Type Parameters
TDerivedEntityTProperty
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 HasAnnotation(string annotation, object? value)
Parameters
annotationstringThe key of the annotation to be added or updated.
valueobjectThe value to be stored in the annotation.
Returns
- StoredProcedureBuilder
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 HasOriginalValueParameter(string propertyName)
Parameters
propertyNamestringThe property name.
Returns
- StoredProcedureBuilder
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 HasOriginalValueParameter(string propertyName, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyNamestringThe parameter name.
buildActionAction<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder
The same builder instance so that multiple configuration calls can be chained.
HasParameter(string)
Configures a new parameter if no parameter mapped to the given property exists.
public virtual StoredProcedureBuilder HasParameter(string propertyName)
Parameters
propertyNamestringThe property name.
Returns
- StoredProcedureBuilder
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 HasParameter(string propertyName, Action<StoredProcedureParameterBuilder> buildAction)
Parameters
propertyNamestringThe parameter name.
buildActionAction<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder
The same builder instance so that multiple configuration calls can be chained.
HasResultColumn(string)
Configures a new column of the result for this stored procedure. This is used for database generated columns.
public virtual StoredProcedureBuilder HasResultColumn(string propertyName)
Parameters
propertyNamestringThe property name.
Returns
- StoredProcedureBuilder
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 HasResultColumn(string propertyName, Action<StoredProcedureResultColumnBuilder> buildAction)
Parameters
propertyNamestringThe property name.
buildActionAction<StoredProcedureResultColumnBuilder>An action that performs configuration of the column.
Returns
- StoredProcedureBuilder
The same builder instance so that multiple configuration calls can be chained.
HasRowsAffectedParameter()
Configures a new parameter that returns the rows affected if no such parameter exists.
public virtual StoredProcedureBuilder HasRowsAffectedParameter()
Returns
- StoredProcedureBuilder
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 HasRowsAffectedParameter(Action<StoredProcedureParameterBuilder> buildAction)
Parameters
buildActionAction<StoredProcedureParameterBuilder>An action that performs configuration of the parameter.
Returns
- StoredProcedureBuilder
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 HasRowsAffectedResultColumn()
Returns
- StoredProcedureBuilder
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 HasRowsAffectedResultColumn(Action<StoredProcedureResultColumnBuilder> buildAction)
Parameters
buildActionAction<StoredProcedureResultColumnBuilder>
Returns
- StoredProcedureBuilder
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 HasRowsAffectedReturnValue(bool rowsAffectedReturned = true)
Parameters
rowsAffectedReturnedboolA value indicating whether this stored procedure returns the number of rows affected.
Returns
- StoredProcedureBuilder
The same builder instance so that multiple configuration calls can be chained.