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 (an EntityRef) to a TwitterUser object.

Conversely, on the many side of the relationship, the TwitterUser property of the TimelineItem declares that the TwitterUserId property holds the foreign key of the TwitterUser.

An EntityRef represents the one side of a one-to-many relationship, whereas an EntitySet is the reciprocal and represents the many side.

..................Content has been hidden....................

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