O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

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

Multiple relationships

Now let’s take a look at the second situation that Entity Framework has trouble with: tables with multiple relationships. It uses a different annotation (InverseProperty instead of ForeignKey), but it’s no more complicated than creating a schema with a single one-to-one relationship between tables.

This is the schema we want to create.

Image

And here are the classes we’ll need to do it.

Image

Image Put On Your Thinking Hat

Ready to give ...

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