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
-
IReadOnlyAnnotatableIAnnotatable
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
stringThe model name.
model
RuntimeModelThe model.
returnType
TypeThe return type.
storeName
stringThe store name.
schema
stringThe store schema.
storeType
stringThe store type.
methodInfo
MethodInfoThe mapped MethodInfo.
scalar
boolWhether the return type is scalar.
aggregate
boolWhether the function is an aggregate.
nullable
boolWhether the function is nullable.
builtIn
boolWhether the function is built-in.
typeMapping
RelationalTypeMappingThe 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
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
stringThe parameter name.
clrType
TypeThe parameter type.
propagatesNullability
boolA value which indicates whether the parameter propagates nullability.
storeType
stringThe store type of this parameter.
typeMapping
RelationalTypeMappingThe 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.