ConventionEntityTypeExtensions.SetDefiningQuery Method

Definition

Caution

Use InMemoryEntityTypeExtensions.SetInMemoryQuery

Sets the LINQ query used as the default source for queries of this type.

public static void SetDefiningQuery (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, System.Linq.Expressions.LambdaExpression definingQuery, bool fromDataAnnotation = false);
[System.Obsolete("Use InMemoryEntityTypeExtensions.SetInMemoryQuery")]
public static void SetDefiningQuery (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, System.Linq.Expressions.LambdaExpression definingQuery, bool fromDataAnnotation = false);
[System.Obsolete("Use InMemoryEntityTypeExtensions.SetInMemoryQuery")]
public static void SetDefiningQuery (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, System.Linq.Expressions.LambdaExpression? definingQuery, bool fromDataAnnotation = false);
static member SetDefiningQuery : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Linq.Expressions.LambdaExpression * bool -> unit
[<System.Obsolete("Use InMemoryEntityTypeExtensions.SetInMemoryQuery")>]
static member SetDefiningQuery : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * System.Linq.Expressions.LambdaExpression * bool -> unit
<Extension()>
Public Sub SetDefiningQuery (entityType As IConventionEntityType, definingQuery As LambdaExpression, Optional fromDataAnnotation As Boolean = false)

Parameters

entityType
IConventionEntityType

The entity type.

definingQuery
LambdaExpression

The LINQ query used as the default source.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Attributes

Applies to