Primary Identifier Mappings

Primary identifier mapping is mandatory in ADO.NET and ADO.NET CF. Primary identifiers of entity classes are mapped to primary keys of master tables in data sources. If not defined, a default primary identifier mapping will be generated, but this may not work properly.

Mapped classes must declare the primary key column of the database table. Most classes will also have a property holding the unique identifier of an instance.

There are three kinds of primary identifier mapping in ADO.NET and ADO.NET CF: