RelationalModelBuilderExtensions.HasDbFunction Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasDbFunction(ModelBuilder, MethodInfo) |
Configures a database function when targeting a relational database. |
HasDbFunction(IConventionModelBuilder, MethodInfo, Boolean) |
Configures a relational database function. |
HasDbFunction(ModelBuilder, MethodInfo, Action<DbFunctionBuilder>) |
Configures a database function when targeting a relational database. |
HasDbFunction(IConventionModelBuilder, String, Type, Boolean) |
Configures a relational database function. |
HasDbFunction<TResult>(ModelBuilder, Expression<Func<TResult>>) |
Configures a database function when targeting a relational database. |
HasDbFunction(ModelBuilder, MethodInfo)
Configures a database function when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder HasDbFunction (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, System.Reflection.MethodInfo methodInfo);
static member HasDbFunction : Microsoft.EntityFrameworkCore.ModelBuilder * System.Reflection.MethodInfo -> Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder
<Extension()>
Public Function HasDbFunction (modelBuilder As ModelBuilder, methodInfo As MethodInfo) As DbFunctionBuilder
Parameters
- modelBuilder
- ModelBuilder
The model builder.
- methodInfo
- MethodInfo
The methodInfo this dbFunction uses.
Returns
A builder to further configure the function.
Remarks
See Database functions for more information and examples.
Applies to
HasDbFunction(IConventionModelBuilder, MethodInfo, Boolean)
Configures a relational database function.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDbFunctionBuilder HasDbFunction (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, System.Reflection.MethodInfo methodInfo, bool fromDataAnnotation = false);
static member HasDbFunction : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * System.Reflection.MethodInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDbFunctionBuilder
<Extension()>
Public Function HasDbFunction (modelBuilder As IConventionModelBuilder, methodInfo As MethodInfo, Optional fromDataAnnotation As Boolean = false) As IConventionDbFunctionBuilder
Parameters
- modelBuilder
- IConventionModelBuilder
The model builder.
- methodInfo
- MethodInfo
The method this function uses.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder to further configure the function.
Remarks
See Database functions for more information and examples.
Applies to
HasDbFunction(ModelBuilder, MethodInfo, Action<DbFunctionBuilder>)
Configures a database function when targeting a relational database.
public static Microsoft.EntityFrameworkCore.ModelBuilder HasDbFunction (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, System.Reflection.MethodInfo methodInfo, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder> builderAction);
static member HasDbFunction : Microsoft.EntityFrameworkCore.ModelBuilder * System.Reflection.MethodInfo * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder> -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function HasDbFunction (modelBuilder As ModelBuilder, methodInfo As MethodInfo, builderAction As Action(Of DbFunctionBuilder)) As ModelBuilder
Parameters
- modelBuilder
- ModelBuilder
The model builder.
- methodInfo
- MethodInfo
The methodInfo this dbFunction uses.
- builderAction
- Action<DbFunctionBuilder>
An action that performs configuration of the sequence.
Returns
A builder to further configure the function.
Remarks
See Database functions for more information and examples.
Applies to
HasDbFunction(IConventionModelBuilder, String, Type, Boolean)
Configures a relational database function.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDbFunctionBuilder HasDbFunction (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string name, Type returnType, bool fromDataAnnotation = false);
static member HasDbFunction : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * string * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDbFunctionBuilder
<Extension()>
Public Function HasDbFunction (modelBuilder As IConventionModelBuilder, name As String, returnType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionDbFunctionBuilder
Parameters
- modelBuilder
- IConventionModelBuilder
The model builder.
- name
- String
The name of the function.
- returnType
- Type
The function's return type.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder to further configure the function.
Remarks
See Database functions for more information and examples.
Applies to
HasDbFunction<TResult>(ModelBuilder, Expression<Func<TResult>>)
Configures a database function when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder HasDbFunction<TResult> (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, System.Linq.Expressions.Expression<Func<TResult>> expression);
static member HasDbFunction : Microsoft.EntityFrameworkCore.ModelBuilder * System.Linq.Expressions.Expression<Func<'Result>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.DbFunctionBuilder
<Extension()>
Public Function HasDbFunction(Of TResult) (modelBuilder As ModelBuilder, expression As Expression(Of Func(Of TResult))) As DbFunctionBuilder
Type Parameters
- TResult
Parameters
- modelBuilder
- ModelBuilder
The model builder.
- expression
- Expression<Func<TResult>>
The method this dbFunction uses.
Returns
A builder to further configure the function.
Remarks
See Database functions for more information and examples.
Applies to
Entity Framework