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.
[Table][Index(Columns = "ScreenName" ...
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.