DbContext.Query<TQuery> 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.
Caution
Use Set() for entity types without keys
Creates a DbSet<TEntity> that can be used to query instances of 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)
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework