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-eftool be used for? - What type would you use for the property that represents a table, for example, the
Productsproperty of a data context? - What type would you use for the property that represents a one-to-many relationship, for example, the
Productsproperty of aCategoryentity? - 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
IMaterializationInterceptorinterface 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...