Using the Column Attribute

Each property of the TimelineItem is decorated with a Column attribute, which tells the DataContext that the property is stored in a column by the same name. As with TableAttribute, you can use its Name property to specify a different name for the column in the database.

ColumnAttribute includes various other properties described in the following sections.

IsPrimaryKey

IsPrimaryKey is used to designate the member or members of the entity class that compose the primary key of the table. Composite keys are also supported by supplying more than one property decorated with a Column attribute with IsPrimaryKey set to true.

At least one member of an entity class must be designated as the primary key, or else the entity ...

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.