DbContext.Query<TQuery> Method

Definition

Caution

Use Set() for entity types without keys

Creates a DbSet<TEntity> that can be used to query instances of TQuery.

C#
public virtual Microsoft.EntityFrameworkCore.DbQuery<TQuery> Query<TQuery> () where TQuery : class;
C#
[System.Obsolete("Use Set() for entity types without keys")]
public virtual Microsoft.EntityFrameworkCore.DbQuery<TQuery> Query<TQuery> () where TQuery : class;

Type Parameters

TQuery

The type of query for which a DbQuery should be returned.

Returns

A DbQuery for the given keyless entity type.

Attributes

Applies to

Product Versions (Obsolete)
Entity Framework Core 2.1, 2.2 (3.0, 3.1)