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 3.1 – Test your knowledge
Answer the following questions:
- What can the
dotnet-ef
tool be used for? - What type would you use for the property that represents a table, for example, the
Products
property of a data 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?
- Why might you choose the Fluent API in preference to annotation attributes?
- Why might you implement the
IMaterializationInterceptor
interface in an entity type?
Exercise 3.2 – Practice benchmarking ADO.NET against EF Core
In the Chapter03
solution, create a console app named Ch03Ex02_ADONETvsEFCore
that uses Benchmark...