Building Relationships – Understanding Mapping

In Chapter 3Relationships – Terminology and Conventions, we studied terminologies and conventions used in a relationship; let's start using them in building relationships. We have been using only Blog and Post entities so far, which doesn't do any good to the blogging system. Let's expand them to other entities such as CommentTag, and so on, and we will leverage them to understand the relationships as well.

The relationship was introduced right from the initial Entity Framework (EF) version, but there was a limitation on the bi-directional relationship. In the matured framework, we have support for multiplicity, enabling that multiple entities can be related together.

The topics we will cover in this chapter are:

  • Relationships:
    • One-to-one
    • One-to-many
    • Many-to-many
  • Fluent API:
    • Identifying navigation property and inverse navigation
    • Identifying single navigation property
    • Relationship-building techniques
    • Cascade delete
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset