Table of Contents

Class RuntimeDbFunction

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

Represents a relational database function in a model.

public class RuntimeDbFunction : AnnotatableBase, IRuntimeDbFunction, IDbFunction, IReadOnlyDbFunction, IReadOnlyAnnotatable, IAnnotatable
Inheritance
RuntimeDbFunction
Implements
IReadOnlyAnnotatable
IAnnotatable

Remarks

See Database functions for more information and examples.

Constructors

RuntimeDbFunction(string, RuntimeModel, Type, string, string?, string?, MethodInfo?, bool, bool, bool, bool, RelationalTypeMapping?, Func<IReadOnlyList<SqlExpression>, SqlExpression>?)

Initializes a new instance of the RuntimeDbFunction class.

public RuntimeDbFunction(string modelName, RuntimeModel model, Type returnType, string storeName, string? schema = null, string? storeType = null, MethodInfo? methodInfo = null, bool scalar = false, bool aggregate = false, bool nullable = false, bool builtIn = false, RelationalTypeMapping? typeMapping = null, Func<IReadOnlyList<SqlExpression>, SqlExpression>? translation = null)

Parameters

modelName string

The model name.

model RuntimeModel

The model.

returnType Type

The return type.

storeName string

The store name.

schema string

The store schema.

storeType string

The store type.

methodInfo MethodInfo

The mapped MethodInfo.

scalar bool

Whether the return type is scalar.

aggregate bool

Whether the function is an aggregate.

nullable bool

Whether the function is nullable.

builtIn bool

Whether the function is built-in.

typeMapping RelationalTypeMapping

The type mapping for the return value.

translation Func<IReadOnlyList<SqlExpression>, SqlExpression>

The function translation.

Properties

DebugView

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 virtual DebugView DebugView { get; }

Property Value

DebugView

Model

Gets the model in which this function is defined.

public virtual RuntimeModel Model { get; }

Property Value

RuntimeModel

ModelName

Gets the name of the function in the model.

public virtual string ModelName { get; }

Property Value

string

TypeMapping

Gets or sets the type mapping for the function's return type.

public virtual RelationalTypeMapping? TypeMapping { get; set; }

Property Value

RelationalTypeMapping

The type mapping.

Methods

AddParameter(string, Type, bool, string, RelationalTypeMapping?)

Adds a parameter to the function.

public virtual RuntimeDbFunctionParameter AddParameter(string name, Type clrType, bool propagatesNullability, string storeType, RelationalTypeMapping? typeMapping = null)

Parameters

name string

The parameter name.

clrType Type

The parameter type.

propagatesNullability bool

A value which indicates whether the parameter propagates nullability.

storeType string

The store type of this parameter.

typeMapping RelationalTypeMapping

The RelationalTypeMapping for this parameter.

Returns

RuntimeDbFunctionParameter

The new parameter.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.