Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring this chapter's topics with deeper research.
Exercise 10.1 – Test your knowledge
Answer the following questions:
- What type would you use for the property that represents a table, for example, the
Products
property of a database context? - What type would you use for the property that represents a one-to-many relationship, for example, the
Products
property of aCategory
entity? - What is the EF Core convention for primary keys?
- When might you use an annotation attribute in an entity class?
- Why might you choose the Fluent API in preference to annotation attributes?
- What does a transaction isolation level of
Serializable
mean? - What does the
DbContext.SaveChanges()
method return? - What is the difference between eager loading and explicit loading?
- How should you define an EF Core entity class to match the following table?
CREATE TABLE Employees...