O'Reilly logo

Programming Entity Framework, 2nd Edition by Julia Lerman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Implementing a More Real-World Model

In the previous chapters, we discussed the core concepts of the Entity Framework, including the Entity Data Model (EDM), querying, and other straightforward operations. We used a simple database and console application to illustrate key points and keep you focused on the lessons. Now it’s time to look at some more real-world scenarios.

In this chapter, we’ll create a more realistic EDM based on a database of the kind you’re more likely to encounter in your work. The model is based on a more complex sdatabase—the BreakAway database—designed to support a fictional travel agency. With a more complex database, you must typically tweak the EDM you create to resolve naming conflicts and other issues. More complex databases are also likely to contain many-to-many relationships and additional stored procedures, both of which you’ll learn how to handle in this and later chapters.

We’ll build the model using the database-first approach as we did with the sample model in Chapter 2.

Note

Chapter 25 will teach you how to do model-first design, where you define an Entity Data Model from scratch and build a database from that model, and code-first design, which leverages the Entity Framework without using a designer-based model.

Finally, the model will be contained in its own assembly so that you can reuse it. We’ll use the model and add to it throughout the rest of the book.

The model you will build here, though more realistic than the sample model of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required