21 DbContext & Sets questions from the EF Core bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the overridable method where a context selects its provider and connection string when options are not injected externally
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.the method that detects pending changes on tracked entities and writes them to the database within a single transaction
Answer + AI explanation with Pro
2. Which term means: "the primary class representing a session with the database, exposing entity collections and tracking changes to objects"?
Junior
A.DbContextOptions
B.DbSet<T>
C.DbContext
D.unit of work
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.DbContext — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
B.DbContext — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.DbContext — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
D.DbContext — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
Answer + AI explanation with Pro
4. What is DbSet<T>?
Junior
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
C.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
D.the overridable method where a context selects its provider and connection string when options are not injected externally
Answer + AI explanation with Pro
5. Which term means: "a property exposing a collection of a given entity type, used as the queryable and insertable root for that table"?
Junior
A.DbContextOptions
B.SaveChangesAsync
C.DbSet<T>
D.SaveChanges
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.DbSet<T> — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
B.DbSet<T> — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.DbSet<T> — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
D.DbSet<T> — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
Answer + AI explanation with Pro
7. What is unit of work?
Mid
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
C.the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
D.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
Answer + AI explanation with Pro
8. Which term means: "the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation"?
Mid
A.unit of work
B.SaveChangesAsync
C.OnConfiguring
D.SaveChanges
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.unit of work — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
B.unit of work — the overridable method where a context selects its provider and connection string when options are not injected externally
C.unit of work — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
D.unit of work — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
Answer + AI explanation with Pro
10. What is SaveChanges?
Junior
A.the overridable method where a context selects its provider and connection string when options are not injected externally
B.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
C.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
D.the method that detects pending changes on tracked entities and writes them to the database within a single transaction
Answer + AI explanation with Pro
11. Which term means: "the method that detects pending changes on tracked entities and writes them to the database within a single transaction"?
Junior
A.unit of work
B.SaveChanges
C.DbContext
D.OnConfiguring
Answer + AI explanation with Pro
12. Which statement is correct?
Junior
A.SaveChanges — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
B.SaveChanges — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
C.SaveChanges — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
D.SaveChanges — the overridable method where a context selects its provider and connection string when options are not injected externally
Answer + AI explanation with Pro
13. What is SaveChangesAsync?
Mid
A.the overridable method where a context selects its provider and connection string when options are not injected externally
B.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
Answer + AI explanation with Pro
14. Which term means: "the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows"?
Mid
A.unit of work
B.SaveChangesAsync
C.DbContext
D.OnConfiguring
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.SaveChangesAsync — a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
B.SaveChangesAsync — the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
C.SaveChangesAsync — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
D.SaveChangesAsync — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
Answer + AI explanation with Pro
16. What is OnConfiguring?
Mid
A.the primary class representing a session with the database, exposing entity collections and tracking changes to objects
B.the overridable method where a context selects its provider and connection string when options are not injected externally
C.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
D.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
Answer + AI explanation with Pro
17. Which term means: "the overridable method where a context selects its provider and connection string when options are not injected externally"?
Mid
A.DbContext
B.OnConfiguring
C.DbContextOptions
D.SaveChanges
Answer + AI explanation with Pro
18. Which statement is correct?
Mid
A.OnConfiguring — the method that detects pending changes on tracked entities and writes them to the database within a single transaction
B.OnConfiguring — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
C.OnConfiguring — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
D.OnConfiguring — the overridable method where a context selects its provider and connection string when options are not injected externally
Answer + AI explanation with Pro
19. What is DbContextOptions?
Senior
A.the awaitable variant that persists pending changes without blocking the calling thread, returning the count of affected rows
B.a property exposing a collection of a given entity type, used as the queryable and insertable root for that table
C.the overridable method where a context selects its provider and connection string when options are not injected externally
D.the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
Answer + AI explanation with Pro
20. Which term means: "the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance"?
Senior
A.unit of work
B.DbContext
C.OnConfiguring
D.DbContextOptions
Answer + AI explanation with Pro
21. Which statement is correct?
Senior
A.DbContextOptions — the pattern by which the context batches all tracked inserts, updates, and deletes and commits them together as one logical operation
B.DbContextOptions — the overridable method where a context selects its provider and connection string when options are not injected externally
C.DbContextOptions — the primary class representing a session with the database, exposing entity collections and tracking changes to objects
D.DbContextOptions — the configuration object, usually built via a builder and injected through the constructor, that supplies provider and behavior settings to a context instance
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every DbContext & Sets question come with Pro.