AddAssociation
AddAssociation
allows you to add a one-to-many association between two entities. This method results in a foreign key constraint being added to the column that holds the primary key of the foreign table.
AddAssociation
accepts a single parameter, associationPropertyName
, which is the name of the entity member that holds the foreign key of another table.
To illustrate, if we were to add a new association between the TwitterUser
and the TimelineItem
classes that matches the existing association, we would first set about by adding a new property to the TimelineItem
class to hold the id of a TwitterUser
, like so:
[Table]public class TimelineItem : NotifyPropertyChangeBase{ string twitterUser2Id; [ ...
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.