We have learned and built different kinds of relationships supported by EF in this chapter. We started with regular one-to-one, one-to-many, and many-to-many relationships, and from there applied a few Fluent API methods to achieve relationships. Then, we covered different usages of the Fluent API on the terminologies we saw in Chapter 3, Relationships – Terminology and Conventions. Finally, we have seen the behavior of Delete
operations on dependent entities if a principal entity gets deleted. These sections dealt with relationships, but never looked at validations, except where required. Let's explore them in the next chapter.
We have explored about different kind in-built relationships, leveraged Fluent API methods in creating relationships. We have also looked at the use of the Fluent API on navigational properties, mandating certain fields using isRequired()
, implementing principal and foreign keys using HasPrincipalKey()
and...