Using Query Types/Keyless Entity Types

Entity Framework Core 2.1 introduced query types, which are similar to usual entity types, but differ from them in certain aspects. The main differences are the following:

Query types do not require a primary key.
Query type changes are not tracked by the context, and are not applied to the database.
Query types can have navigation properties to entity types, but classes cannot have navigation properties.

For more information about query types and their differences, see Entity Framework Core documentation.

For Entity Framework Core 3, Entity Developer generates keyless entity types instead of query types.

 

ExpandedToggleIcon        Query Types in Entity Developer

Entity Developer fully supports query types. To generate a class as a query type for Entity Framework Core 2/keyless entity type for Entity Framework Core 3, set its Query Type property to True:

query_type_property

Query types support both mapping to tables or views and to Raw SQL Queries.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.