Table of Contents

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

IConventionDbFunction

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 bool

The value indicating whether the database function is built-in or not.

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.

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 bool

The value indicating whether the database function can return null value or not.

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.

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 string

The name of the function 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 database function.

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 string

The schema of the function 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.

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 string

The store type of the function in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given store type can be set for the database function.

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 bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

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

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 RelationalTypeMapping

The return type mapping of the function in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given return type mapping can be set for the database function.

HasName(string, bool)

Sets the name of the database function.

IConventionDbFunctionBuilder HasName(string name, bool fromDataAnnotation = false)

Parameters

name string

The name of the function in the database.

fromDataAnnotation bool

Indicates 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 string

The parameter name.

fromDataAnnotation bool

Indicates 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 string

The schema of the function in the database.

fromDataAnnotation bool

Indicates 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 string

The store type of the function in the database.

fromDataAnnotation bool

Indicates 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 bool

Indicates 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 RelationalTypeMapping

The return type mapping of the function in the database.

fromDataAnnotation bool

Indicates 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 bool

The value indicating whether the database function is built-in or not.

fromDataAnnotation bool

Indicates 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 bool

The value indicating whether the database function is built-in or not.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionDbFunctionBuilder

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