Multiplicity and the Association Attribute

One-to-many entity relationships can be defined by decorating entity properties with Association attributes. Two entities participating in a one-to-many relationship with each other each use properties of the Association attribute to indicate on which side each resides.

One-to-many entity relationships are represented as foreign key relationships in the database.

The one-to-many relationship between TwitterUser and TimelineItem is defined with an Association attribute placed on the TwitterUser property of the TimelineItem class. The attribute declares that the TwitterUserId column of the TimelineItem table is a foreign key of the TwitterUser table. It also declares that the user field holds a reference ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.