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
modelNamestringThe model name.
modelRuntimeModelThe model.
returnTypeTypeThe return type.
storeNamestringThe store name.
schemastringThe store schema.
storeTypestringThe store type.
methodInfoMethodInfoThe mapped MethodInfo.
scalarboolWhether the return type is scalar.
aggregateboolWhether the function is an aggregate.
nullableboolWhether the function is nullable.
builtInboolWhether the function is built-in.
typeMappingRelationalTypeMappingThe type mapping for the return value.
translationFunc<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
namestringThe parameter name.
clrTypeTypeThe parameter type.
propagatesNullabilityboolA value which indicates whether the parameter propagates nullability.
storeTypestringThe store type of this parameter.
typeMappingRelationalTypeMappingThe 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.