Chapter 7. Tuning Up a Model

In the previous chapters, we discussed some of the core concepts of the Entity Framework, the Entity Data Model (EDM), querying, and other straightforward operations. The simple database and console application we used illustrated key points and kept you focused on the lessons. Now it’s time to look at some more realistic scenarios.

In this chapter, we’ll create and work with a more realistic model. The model will be contained in its own assembly so that you can reuse it in other applications in your enterprise.

The chapter will also address the important task of clarifying the names used in a model that has been created from a database. You will also learn about many-to-many relationships as well as a few more tips about mapping stored procedures.

The BreakAway Geek Adventures Business Model

The example company for which we will be writing software is called BreakAway Geek Adventures. This small company arranges adventure vacations for hard-working programmers who need a break. Examples of vacations that can be booked through BreakAway Geek Adventures include whitewater rafting in Belize and bicycling in Ireland. The company has been in business for a number of years and has an old application that uses a SQL Server database for its data store. Now it’s time to write shiny new applications for this venerable firm in .NET, leveraging the Entity Framework.

Note

You can download a script for creating this database from the book’s website. Look for the database ...

Get Programming Entity Framework 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.