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.
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 ...