RelationalModelExtensions.AddDbFunction Method

Definition

Overloads

AddDbFunction(IMutableModel, MethodInfo)

Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs

Creates an IMutableDbFunction mapped to the given method.

C#
public static Microsoft.EntityFrameworkCore.Metadata.Internal.DbFunction AddDbFunction (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, System.Reflection.MethodInfo methodInfo);
C#
public static Microsoft.EntityFrameworkCore.Metadata.IMutableDbFunction AddDbFunction (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, System.Reflection.MethodInfo methodInfo);

Parameters

model
IMutableModel

The model to add the function to.

methodInfo
MethodInfo

The MethodInfo for the method that is mapped to the function.

Returns

Microsoft.EntityFrameworkCore.Metadata.Internal.DbFunction

The new IMutableDbFunction.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddDbFunction(IConventionModel, MethodInfo, Boolean)

Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs

Creates a function mapped to the given method.

C#
public static Microsoft.EntityFrameworkCore.Metadata.IConventionDbFunction AddDbFunction (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, System.Reflection.MethodInfo methodInfo, bool fromDataAnnotation = false);

Parameters

model
IConventionModel

The model to add the function to.

methodInfo
MethodInfo

The MethodInfo for the method that is mapped to the function.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The new function.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddDbFunction(IMutableModel, String, Type)

Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs

Creates a function.

C#
public static Microsoft.EntityFrameworkCore.Metadata.IMutableDbFunction AddDbFunction (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, string name, Type returnType);

Parameters

model
IMutableModel

The model to add the function to.

name
String

The model name of the function.

returnType
Type

The function return type.

Returns

The new function.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0

AddDbFunction(IConventionModel, String, Type, Boolean)

Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs
Source:
RelationalModelExtensions.cs

Creates a function.

C#
public static Microsoft.EntityFrameworkCore.Metadata.IConventionDbFunction AddDbFunction (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, string name, Type returnType, bool fromDataAnnotation = false);

Parameters

model
IConventionModel

The model to add the function to.

name
String

The model name of the function.

returnType
Type

The function return type.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The new function.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0