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

AddTable

Using the AddTable method allows you to create a new table for an entity class. On adding a new table, the DatabaseSchemaUpdater also applies the metadata associated with the entity class and creates any related indexes or foreign key constraints.

To add a new entity to the Twitter data model, we first create that entity and decorate it with Table and Column attributes. In the following example, the TwitterFriend class represents a Twitter user, who happens to be a contact of another Twitter user (see Listing 29.10). TwitterFriend contains an Id and a ScreenName property. In addition, an index is declared for the ScreenName property.

LISTING 29.10. TwitterFriend Class

[Table][Index(Columns = "ScreenName" ...

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