Table of Contents

Interface IConventionDbFunction

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

Represents a relational database function in a model in the form that can be mutated while the model is being built.

public interface IConventionDbFunction : IReadOnlyDbFunction, IReadOnlyAnnotatable, IConventionAnnotatable
Inherited Members

Remarks

See Database functions for more information and examples.

Properties

Builder

Gets the builder that can be used to configure this function.

IConventionDbFunctionBuilder Builder { get; }

Property Value

IConventionDbFunctionBuilder

Exceptions

InvalidOperationException

If the function has been removed from the model.

Model

Gets the model in which this function is defined.

IConventionModel Model { get; }

Property Value

IConventionModel

Parameters

Gets the parameters for this function

IReadOnlyList<IConventionDbFunctionParameter> Parameters { get; }

Property Value

IReadOnlyList<IConventionDbFunctionParameter>

Methods

GetConfigurationSource()

Gets the configuration source for this function.

ConfigurationSource GetConfigurationSource()

Returns

ConfigurationSource

The configuration source for this function.

GetIsBuiltInConfigurationSource()

Gets the configuration source for IsBuiltIn.

ConfigurationSource? GetIsBuiltInConfigurationSource()

Returns

ConfigurationSource?

The configuration source for IsBuiltIn.

GetIsNullableConfigurationSource()

Gets the configuration source for IsNullable.

ConfigurationSource? GetIsNullableConfigurationSource()

Returns

ConfigurationSource?

The configuration source for IsNullable.

GetNameConfigurationSource()

Gets the configuration source for Name.

ConfigurationSource? GetNameConfigurationSource()

Returns

ConfigurationSource?

The configuration source for Name.

GetSchemaConfigurationSource()

Gets the configuration source for Schema.

ConfigurationSource? GetSchemaConfigurationSource()

Returns

ConfigurationSource?

The configuration source for Schema.

GetStoreTypeConfigurationSource()

Gets the configuration source for StoreType.

ConfigurationSource? GetStoreTypeConfigurationSource()

Returns

ConfigurationSource?

The configuration source for StoreType.

GetTranslationConfigurationSource()

Gets the configuration source for Translation.

ConfigurationSource? GetTranslationConfigurationSource()

Returns

ConfigurationSource?

The configuration source for Translation.

GetTypeMappingConfigurationSource()

Gets the configuration source for TypeMapping.

ConfigurationSource? GetTypeMappingConfigurationSource()

Returns

ConfigurationSource?

The configuration source for TypeMapping.

SetIsBuiltIn(bool, bool)

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

bool SetIsBuiltIn(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

The configured value.

SetIsNullable(bool, bool)

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

bool SetIsNullable(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

The configured value.

SetName(string?, bool)

Sets the name of the function in the database.

string? SetName(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

string

The configured value.

SetSchema(string?, bool)

Sets the schema of the function in the database.

string? SetSchema(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

string

The configured value.

SetStoreType(string?, bool)

Sets the store type of the function in the database.

string? SetStoreType(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

string

The configured value.

SetTranslation(Func<IReadOnlyList<SqlExpression>, SqlExpression>?, bool)

Sets the translation callback for performing custom translation of the method call into a SQL expression fragment.

Func<IReadOnlyList<SqlExpression>, SqlExpression>? SetTranslation(Func<IReadOnlyList<SqlExpression>, SqlExpression>? translation, bool fromDataAnnotation = false)

Parameters

translation Func<IReadOnlyList<SqlExpression>, SqlExpression>

The translation callback for performing custom translation of the method call into a SQL expression fragment.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

Func<IReadOnlyList<SqlExpression>, SqlExpression>

The configured value.

SetTypeMapping(RelationalTypeMapping?, bool)

Sets the type mapping of the function in the database.

RelationalTypeMapping? SetTypeMapping(RelationalTypeMapping? typeMapping, bool fromDataAnnotation = false)

Parameters

typeMapping RelationalTypeMapping

The type mapping of the function in the database.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

RelationalTypeMapping

The configured value.