Table of Contents

Class DbFunctionBuilder

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

Provides a simple API for configuring a IMutableDbFunction.

public class DbFunctionBuilder : DbFunctionBuilderBase, IInfrastructure<IConventionDbFunctionBuilder>
Inheritance
DbFunctionBuilder
Implements
Inherited Members

Constructors

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.

public DbFunctionBuilder(IMutableDbFunction function)

Parameters

function IMutableDbFunction

Methods

HasName(string)

Sets the name of the database function.

public virtual DbFunctionBuilder HasName(string name)

Parameters

name string

The name of the function in the database.

Returns

DbFunctionBuilder

The same builder instance so that multiple configuration calls can be chained.

HasSchema(string)

Sets the schema of the database function.

public virtual DbFunctionBuilder HasSchema(string schema)

Parameters

schema string

The schema of the function in the database.

Returns

DbFunctionBuilder

The same builder instance so that multiple configuration calls can be chained.

HasStoreType(string)

Sets the return store type of the database function.

public virtual DbFunctionBuilder HasStoreType(string storeType)

Parameters

storeType string

The return store type of the function in the database.

Returns

DbFunctionBuilder

The same builder instance so that multiple configuration calls can be chained.

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.

public virtual DbFunctionBuilder HasTranslation(Func<IReadOnlyCollection<SqlExpression>, SqlExpression> translation)

Parameters

translation Func<IReadOnlyCollection<SqlExpression>, SqlExpression>

The translation to use.

Returns

DbFunctionBuilder

The same builder instance so that multiple configuration calls can be chained.

IsBuiltIn(bool)

Marks whether the database function is built-in.

public virtual DbFunctionBuilder IsBuiltIn(bool builtIn = true)

Parameters

builtIn bool

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

Returns

DbFunctionBuilder

The same builder instance so that multiple configuration calls can be chained.

IsNullable(bool)

Marks whether the database function can return null value.

public virtual DbFunctionBuilderBase IsNullable(bool nullable = true)

Parameters

nullable bool

The value indicating whether the database function can return null.

Returns

DbFunctionBuilderBase

The same builder instance so that multiple configuration calls can be chained.