What is an effective tool that allows .NET programmers to work with relational data but is not necessarily good in developer efficiency?
ADO.NET
What did Microsoft introduce since ADO.NET was not good enough in developer efficiency?
Entity Framework
What are the strongly typed objects held in specialized LINQ aware collection classes operated on in Entity Framework called?
Entities
What data annotation in EF declares a property that is used as the foreign key for a navigation property?
ForeignKey
What data annotation in EF declares a property as not nullable in the database?
Required
What data annotation lets EF Core know which property is the backing field for a navigation property?
ForeignKey
What data annotation informs EF Core of how entities are related by indicating the navigation property on the other end, and also makes the code more readable?
InverseProperty
What data annotation in EF excludes a property or class in regard to database fields and tables?
NotMapped
What data annotation in EF declares the navigation property on the other end of a relationship?
InverseProperty
In a one-to-many relationship in EF, the one side entity is the principal or dependent entity?
The principal
In a one-to-many relationship in EF, the many side entity is the principal or dependent entity?
The dependent
What class is the ringleader component of EF Core?
DbContext
What property of the DbContext class provides access to the database?
Database
What class in EF Core holds all of the DbSet<T> properties?
DbContext
What class in EF Core provides the SaveChanges() method that persists changes to the data store?
DbContext
What member of DbContext saves all entity changes to the database (in a transaction) and returns the number of records affected?
SaveChanges()
What three members of DbContext can add, update, and remove entity instances, respectively, and also are usually called directly on the DbSet<T> properties?
Add(), Update(), Remove()
What is the member of DbContext that provides access to information and operations for entity instances that the DbContext is tracking?
ChangeTracker
What is the state of an EF entity that is being tracked but does not yet exist in the database?
Added
What is the state of an EF entity that is being tracked and is marked for deletion from the database?
Deleted
What is the state of an EF entity that is not being tracked by the change tracker?
Detached
What is the state of an EF entity that is being tracked and has been changed?
Modified
What is the state of an EF entity that is being tracked, exists in the database, and has not been modified?
Unchanged
What is the recommended way (a type) to configure the DbContext instance at runtime?
DbContextOptions
What is the recommended way (a type) to configure the DbContext instance at design time?
IDesignTimeDbContextFactory
What is the member of DbContext that is called when a model has been initialized, but before it has been finalized, and is where methods from the Fluent API are used to finalize the shape of the model?
OnModelCreating()
What is the first thing or step to do in EF Core?
Create a custom class that inherits from DbContext
What method does the DbContext class expose that is used to shape your entities using the Fluent API?
OnModelCreating()
What class is a specialized collection property used to interact with the database provider to read, add, update, and delete records in the database?
DbSet<T>
What interface does the DbSet<T> implement which enables the use of LINQ queries to retrieve records from the database?
IQueryable<T>
What are the strongly typed classes that map to database tables called in EF?
Entities
How is the conceptual model of a physical database in Entity Framework (the entity data model) commonly referred to?
The model
What are the two class to table mapping schemes available in EF Core?
Table-per-hierarchy (TPH) and table-per-type (TPT)
What are, by definition, properties that map to a nonscalar type as defined by the database provider?
Navigation properties
The Pro .NET book recommends ORMs for what type of operations?
CRUD operations
The Pro .NET book recommends relying on the database for what type of operations?
Set-based operations
What are the three types which are the most prominent main types in EF?
DbContext, ChangeTracker, DbSet
What type in EF manages the instance of ChangeTracker, exposes the virtual OnModelCreating() method, holds the DbSet<T> properties, and supplies the SaveChanges() method?
DbContext
What member of DbContext has metadata about the shape of entities, the relationships between them, and how they map to the database (usually not used directly)?
Model
What member of DbContext provides access to information and operations for entity instances that the specific DbContext is tracking?
ChangeTracker
LINQ queries against DbSet<T> properties in EF are translated into what?
SQL queries
What happens when the ChangeTracker.Clear() method is used in EF?
All entities in the DbSet<T> collections have their state set to Detached
What approach when building a new app or adding EF Core into an existing application is when you create and configure your entity classes and the derived DbContext in code and then use migrations to update the database?
Code first
What approach when building a new app or adding EF Core into an existing application is when you scaffold the classes from an existing database?
Database first
What is the EF Core tooling that is a global CLI tool with the commands needed to scaffold existing databases into code, to create/remove database migrations, and to operate on a database?
dotnet-ef
What method, called when an EF model has been initialized, but not finalized yet, is where methods from the Fluent API are placed to finalize the shape of the model?
OnModelCreating()
What did ADO.NET lack that made Microsoft introduce Entity Framework?
Developer efficiency
What does this line of code in a class derived from DbContext basically specify?
public DbSet<Car> Cars { get; set; }
The Car class maps to the Cars table in the database
What in EF is a navigation property that maps to another entity (not a collection)?
A reference navigation property
Data retrieval queries in EF Core are created with LINQ queries written against properties of what type?
DbSet<T>
What in EF is a navigation property that maps to a collection of entities?
A collection navigation property
What in EF refers to DbSet<T> collections that are used to represent views, SQL statements, or tables without a primary key?
Query types
What method can you chain on to this to cause the database to be queried immediately?
var cars = context.Cars.Where(x=>x.Color == "Yellow");
ToList()
What do you need to do in between creating a record in code and calling SaveChanges() on the context in order to add the record to the database in EF?
Add the record to its DbSet<T>
Previous card
First card
Random order
Next card