Udostępnij za pośrednictwem


DbFunctionBuilder Class

Definition

Provides a simple API for configuring a IMutableDbFunction.

public class DbFunctionBuilder
public class DbFunctionBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDbFunctionBuilder
public class DbFunctionBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilderBase
type DbFunctionBuilder = class
type DbFunctionBuilder = class
    interface IConventionDbFunctionBuilder
type DbFunctionBuilder = class
    inherit DbFunctionBuilderBase
Public Class DbFunctionBuilder
Public Class DbFunctionBuilder
Implements IConventionDbFunctionBuilder
Public Class DbFunctionBuilder
Inherits DbFunctionBuilderBase
Inheritance
DbFunctionBuilder
Inheritance
DbFunctionBuilder
Implements

Remarks

See Database functions for more information and examples.

Constructors

DbFunctionBuilder(DbFunction)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

DbFunctionBuilder(IMutableDbFunction)

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.

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.

(Inherited from DbFunctionBuilderBase)
Metadata

The function being configured.

Metadata

The function being configured.

(Inherited from DbFunctionBuilderBase)

Methods

HasAnnotation(String, Object)

Adds or updates an annotation on the database function. If an annotation with the key specified in annotation already exists, its value will be updated.

HasName(String)

Sets the name of the database function.

HasParameter(String, Action<DbFunctionParameterBuilder>)

Returns an object that can be used to configure a parameter with the given name. If no parameter with the given name exists, then a new parameter will be added.

HasParameter(String, Action<DbFunctionParameterBuilder>)

Returns an object that can be used to configure a parameter with the given name. If no parameter with the given name exists, then a new parameter will be added.

(Inherited from DbFunctionBuilderBase)
HasParameter(String)

Creates a DbFunctionParameterBuilder for a parameter with the given name.

HasParameter(String)

Returns an object that can be used to configure a parameter with the given name. If no parameter with the given name exists, then a new parameter will be added.

(Inherited from DbFunctionBuilderBase)
HasSchema(String)

Sets the schema of the database function.

HasStoreType(String)

Sets the return store type of the database function.

HasTranslation(Func<IReadOnlyCollection<Expression>,Expression>)

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.

HasTranslation(Func<IReadOnlyCollection<SqlExpression>,SqlExpression>)

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.

HasTranslation(Func<IReadOnlyList<SqlExpression>,SqlExpression>)

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.

IsBuiltIn(Boolean)

Marks whether the database function is built-in.

IsNullable(Boolean)

Marks whether the database function can return null value.

Explicit Interface Implementations

IConventionDbFunctionBuilder.CanSetName(String, Boolean)

Returns a value indicating whether the given name can be set for the database function.

IConventionDbFunctionBuilder.CanSetSchema(String, Boolean)

Returns a value indicating whether the given schema can be set for the database function.

IConventionDbFunctionBuilder.CanSetStoreType(String, Boolean)

Returns a value indicating whether the given store type can be set for the database function.

IConventionDbFunctionBuilder.CanSetTranslation(Func<IReadOnlyCollection<SqlExpression>,SqlExpression>, Boolean)

Returns a value indicating whether the given translation can be set for the database function.

IConventionDbFunctionBuilder.CanSetTypeMapping(RelationalTypeMapping, Boolean)

Returns a value indicating whether the given return type mapping can be set for the database function.

IConventionDbFunctionBuilder.HasName(String, Boolean)

Sets the name of the database function.

IConventionDbFunctionBuilder.HasSchema(String, Boolean)

Sets the schema of the database function.

IConventionDbFunctionBuilder.HasStoreType(String, Boolean)

Sets the store type of the function in the database.

IConventionDbFunctionBuilder.HasTranslation(Func<IReadOnlyCollection<SqlExpression>,SqlExpression>, Boolean)

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.HasTypeMapping(RelationalTypeMapping, Boolean)

Sets the return type mapping of the database function.

IConventionDbFunctionBuilder.Metadata

The function being configured.

IInfrastructure<IConventionDbFunctionBuilder>.Instance

Gets the value of the property being hidden.

(Inherited from DbFunctionBuilderBase)

Extension Methods

GetInfrastructure<T>(IInfrastructure<T>)

Gets the value from a property that is being hidden using IInfrastructure<T>.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

Applies to