O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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;    [ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required