Interface IConventionDbFunctionBuilder
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Provides a simple API for configuring a IConventionDbFunction.
public interface IConventionDbFunctionBuilder : IConventionAnnotatableBuilder
Properties
Metadata
The function being configured.
IConventionDbFunction Metadata { get; }
Property Value
Methods
CanSetIsBuiltIn(bool, bool)
Returns a value indicating whether the given built-in can be set for the database function.
bool CanSetIsBuiltIn(bool builtIn, bool fromDataAnnotation = false)
Parameters
builtIn
boolThe value indicating whether the database function is built-in or not.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetIsNullable(bool, bool)
Returns a value indicating whether the given nullable can be set for the database function.
bool CanSetIsNullable(bool nullable, bool fromDataAnnotation = false)
Parameters
nullable
boolThe value indicating whether the database function can return null value or not.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetName(string, bool)
Returns a value indicating whether the given name can be set for the database function.
bool CanSetName(string name, bool fromDataAnnotation = false)
Parameters
name
stringThe name of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetSchema(string, bool)
Returns a value indicating whether the given schema can be set for the database function.
bool CanSetSchema(string schema, bool fromDataAnnotation = false)
Parameters
schema
stringThe schema of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetStoreType(string, bool)
Returns a value indicating whether the given store type can be set for the database function.
bool CanSetStoreType(string storeType, bool fromDataAnnotation = false)
Parameters
storeType
stringThe store type of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetTranslation(Func<IReadOnlyCollection<SqlExpression>, SqlExpression>, bool)
Returns a value indicating whether the given translation can be set for the database function.
bool CanSetTranslation(Func<IReadOnlyCollection<SqlExpression>, SqlExpression> translation, bool fromDataAnnotation = false)
Parameters
translation
Func<IReadOnlyCollection<SqlExpression>, SqlExpression>The translation to use.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetTypeMapping(RelationalTypeMapping, bool)
Returns a value indicating whether the given return type mapping can be set for the database function.
bool CanSetTypeMapping(RelationalTypeMapping typeMapping, bool fromDataAnnotation = false)
Parameters
typeMapping
RelationalTypeMappingThe return type mapping of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
HasName(string, bool)
Sets the name of the database function.
IConventionDbFunctionBuilder HasName(string name, bool fromDataAnnotation = false)
Parameters
name
stringThe name of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
HasParameter(string, bool)
Returns an object that can be used to configure a parameter with the given name.
IConventionDbFunctionParameterBuilder HasParameter(string name, bool fromDataAnnotation = false)
Parameters
name
stringThe parameter name.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionParameterBuilder
The builder to use for further parameter configuration.
HasSchema(string, bool)
Sets the schema of the database function.
IConventionDbFunctionBuilder HasSchema(string schema, bool fromDataAnnotation = false)
Parameters
schema
stringThe schema of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
HasStoreType(string, bool)
Sets the store type of the function in the database.
IConventionDbFunctionBuilder HasStoreType(string storeType, bool fromDataAnnotation = false)
Parameters
storeType
stringThe store type of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
HasTranslation(Func<IReadOnlyCollection<SqlExpression>, SqlExpression>, bool)
Sets a callback that will be invoked to perform custom translation of this function. The callback takes a collection of expressions corresponding to the parameters passed to the function call. The callback should return an expression representing the desired translation.
See https://go.microsoft.com/fwlink/?linkid=852477 for more information.
IConventionDbFunctionBuilder HasTranslation(Func<IReadOnlyCollection<SqlExpression>, SqlExpression> translation, bool fromDataAnnotation = false)
Parameters
translation
Func<IReadOnlyCollection<SqlExpression>, SqlExpression>The translation to use.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
HasTypeMapping(RelationalTypeMapping, bool)
Sets the return type mapping of the database function.
IConventionDbFunctionBuilder HasTypeMapping(RelationalTypeMapping typeMapping, bool fromDataAnnotation = false)
Parameters
typeMapping
RelationalTypeMappingThe return type mapping of the function in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
IsBuiltIn(bool, bool)
Sets the value indicating whether the database function is built-in or not.
IConventionDbFunctionBuilder IsBuiltIn(bool builtIn, bool fromDataAnnotation = false)
Parameters
builtIn
boolThe value indicating whether the database function is built-in or not.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.
IsNullable(bool, bool)
Sets the value indicating whether the database function can return null value or not.
IConventionDbFunctionBuilder IsNullable(bool nullable, bool fromDataAnnotation = false)
Parameters
nullable
boolThe value indicating whether the database function is built-in or not.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDbFunctionBuilder
The same builder instance if the configuration was applied, null otherwise.