IConventionEntityTypeBuilder.HasDefiningQuery 方法

定義

警告

Use InMemoryEntityTypeBuilderExtensions.ToInMemoryQuery

設定用來提供無索引鍵實體類型的資料的查詢。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder HasDefiningQuery (System.Linq.Expressions.LambdaExpression query, bool fromDataAnnotation = false);
[System.Obsolete("Use InMemoryEntityTypeBuilderExtensions.ToInMemoryQuery")]
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder HasDefiningQuery (System.Linq.Expressions.LambdaExpression query, bool fromDataAnnotation = false);
[System.Obsolete("Use InMemoryEntityTypeBuilderExtensions.ToInMemoryQuery")]
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasDefiningQuery (System.Linq.Expressions.LambdaExpression? query, bool fromDataAnnotation = false);
abstract member HasDefiningQuery : System.Linq.Expressions.LambdaExpression * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
[<System.Obsolete("Use InMemoryEntityTypeBuilderExtensions.ToInMemoryQuery")>]
abstract member HasDefiningQuery : System.Linq.Expressions.LambdaExpression * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function HasDefiningQuery (query As LambdaExpression, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

參數

query
LambdaExpression

提供無索引鍵實體類型的基礎資料的查詢。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

如果已設定查詢,則為相同的產生器實例, null 否則為 。

屬性

適用於