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