DbContext.Query<TQuery> 方法

定义

注意

Use Set() for entity types without keys

DbSet<TEntity>创建可用于查询 实例的 TQuery

public virtual Microsoft.EntityFrameworkCore.DbQuery<TQuery> Query<TQuery> () where TQuery : class;
[System.Obsolete("Use Set() for entity types without keys")]
public virtual Microsoft.EntityFrameworkCore.DbQuery<TQuery> Query<TQuery> () where TQuery : class;
abstract member Query : unit -> Microsoft.EntityFrameworkCore.DbQuery<'Query (requires 'Query : null)> (requires 'Query : null)
override this.Query : unit -> Microsoft.EntityFrameworkCore.DbQuery<'Query (requires 'Query : null)> (requires 'Query : null)
[<System.Obsolete("Use Set() for entity types without keys")>]
abstract member Query : unit -> Microsoft.EntityFrameworkCore.DbQuery<'Query (requires 'Query : null)> (requires 'Query : null)
override this.Query : unit -> Microsoft.EntityFrameworkCore.DbQuery<'Query (requires 'Query : null)> (requires 'Query : null)
Public Overridable Function Query(Of TQuery As Class) () As DbQuery(Of TQuery)

类型参数

TQuery

应为其返回 DbQuery 的查询类型。

返回

给定无键实体类型的 DbQuery。

属性

适用于