O'Reilly logo

Entity Framework 4.0 Recipes: A Problem-Solution Approach by Larry Tenny, Zeeshan Hirani

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 15. Advanced Modeling

The Entity Framework runtime supports a surprisingly wide variety of modeling scenarios, even if the current implementation of the designer does have some limitations. In this chapter, we explore some of the more advanced modeling concepts that are supported by Entity Framework. Many of these models represent real-world challenges dealing with existing databases that may not have been designed with the best approaches.

Creating an Association on a Derived Entity

Problem

You have a table with a nullable foreign key column. You want to model the table using Table per Hierarchy inheritance and map the foreign key column as an association on the derived entity.

Solution

Let's say you have a couple of tables like the ones shown ...

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