© Brian L. Gorman 2020
B. L. GormanPractical Entity Frameworkhttps://doi.org/10.1007/978-1-4842-6044-9_4

4. Models and the Data Context

Brian L. Gorman1 
(1)
Jesup, IA, USA
 

In this chapter, we are going to examine the data context and the creation of models, as well as look in a bit more detail about how these objects work in concert for code-first database programming with Entity Framework.

By the end of the chapter, we’ll have reviewed and become even more familiar with some of the inner workings of the database context. Through practical examples, we’ll also become very familiar with using models to build out our database tables.

What is the database context, and why do we need it?

Taking a quick step back, if you are reading this and you are used ...

Get Practical Entity Framework: Database Access for Enterprise Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.