Easily remember ManyToMany ManyToOne OneToMany

ManyToMany in a Person <> Blog Relationship
A Person can be a subscriber of many blogs.
A Blog can have many subscribers.

But since this is an inefficient way to manage usually a proxy table is used with [PersonID], [BlogID], aka the 2 related data models.

ManyToOne and OneToMany in a Person <> Blog Relationship
A Person can be the owner of many Blogs.
A Blog can have one owner Person.

In conclusion, ToMany means it’s an array, ToOne means it’s a single value.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.