Table of Contents

Interface IConventionStoredProcedureBuilder

Namespace
Microsoft.EntityFrameworkCore.Metadata.Builders
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Provides a simple API for configuring a IConventionStoredProcedure.

public interface IConventionStoredProcedureBuilder : IConventionAnnotatableBuilder

Remarks

See Model building conventions for more information and examples.

Properties

Metadata

The function being configured.

IConventionStoredProcedure Metadata { get; }

Property Value

IConventionStoredProcedure

Methods

CanHaveOriginalValueParameter(string, bool)

Returns a value indicating whether a parameter holds the original value of the mapped property can be used for stored procedure.

bool CanHaveOriginalValueParameter(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the parameter can be used for the stored procedure.

CanHaveParameter(string, bool)

Returns a value indicating whether a parameter mapped to the given property can be used for stored procedure.

bool CanHaveParameter(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the parameter can be used for the stored procedure.

CanHaveResultColumn(string, bool)

Returns a value indicating whether a column of the result mapped to the given property can be used for stored procedure.

bool CanHaveResultColumn(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the column of the result can be used for the stored procedure.

CanHaveRowsAffectedParameter(bool)

Returns a value indicating whether a parameter that returns the rows affected can be used for stored procedure.

bool CanHaveRowsAffectedParameter(bool fromDataAnnotation = false)

Parameters

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the parameter can be used for the stored procedure.

CanHaveRowsAffectedResultColumn(bool)

Returns a value indicating whether a column that contains the rows affected can be used for stored procedure.

bool CanHaveRowsAffectedResultColumn(bool fromDataAnnotation = false)

Parameters

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the column of the result can be used for the stored procedure.

CanSetName(string?, bool)

Returns a value indicating whether the given name can be set for the stored procedure.

bool CanSetName(string? name, bool fromDataAnnotation = false)

Parameters

name string

The name of the stored procedure in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given name can be set for the stored procedure.

CanSetSchema(string?, bool)

Returns a value indicating whether the given schema can be set for the stored procedure.

bool CanSetSchema(string? schema, bool fromDataAnnotation = false)

Parameters

schema string

The schema of the stored procedure in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given schema can be set for the database function.

HasName(string?, bool)

Sets the name of the stored procedure.

IConventionStoredProcedureBuilder? HasName(string? name, bool fromDataAnnotation = false)

Parameters

name string

The name of the stored procedure in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureBuilder

The same builder instance if the configuration was applied, null otherwise.

HasName(string?, string?, bool)

Sets the name and schema of the stored procedure.

IConventionStoredProcedureBuilder? HasName(string? name, string? schema, bool fromDataAnnotation = false)

Parameters

name string

The name of the stored procedure in the database.

schema string

The schema of the stored procedure in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureBuilder

The same builder instance if the configuration was applied, null otherwise.

HasOriginalValueParameter(string, bool)

Configures a new parameter that holds the original value of the property with the given name if no parameter mapped to the given property exists.

IConventionStoredProcedureParameterBuilder? HasOriginalValueParameter(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureParameterBuilder

The builder instance if the configuration was applied, null otherwise.

HasParameter(string, bool)

Configures a new parameter if no parameter mapped to the given property exists.

IConventionStoredProcedureParameterBuilder? HasParameter(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureParameterBuilder

The same builder instance if the configuration was applied, null otherwise.

HasResultColumn(string, bool)

Configures a new column of the result for this stored procedure. This is used for database generated columns.

IConventionStoredProcedureResultColumnBuilder? HasResultColumn(string propertyName, bool fromDataAnnotation = false)

Parameters

propertyName string

The property name.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureResultColumnBuilder

The builder instance if the configuration was applied, null otherwise.

HasRowsAffectedParameter(bool)

Configures a new parameter that returns the rows affected if no such parameter exists.

IConventionStoredProcedureParameterBuilder? HasRowsAffectedParameter(bool fromDataAnnotation = false)

Parameters

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureParameterBuilder

The builder instance if the configuration was applied, null otherwise.

HasRowsAffectedResultColumn(bool)

Configures a new column that contains the rows affected for this stored procedure if no such column exists.

IConventionStoredProcedureResultColumnBuilder? HasRowsAffectedResultColumn(bool fromDataAnnotation = false)

Parameters

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureResultColumnBuilder

The builder instance if the configuration was applied, null otherwise.

HasSchema(string?, bool)

Sets the schema of the stored procedure.

IConventionStoredProcedureBuilder? HasSchema(string? schema, bool fromDataAnnotation = false)

Parameters

schema string

The schema of the stored procedure in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionStoredProcedureBuilder

The same builder instance if the configuration was applied, null otherwise.