Data Access has been discontinued. Please refer to this page for more information.

DatabaseServerCalculated Identity Mechanism

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

This topic provides an example of how to work with the DatabaseServerCalculated identity mechanism. DatabaseServerCalculated means that the primary key column in the database is auto-incremental.

To complete this tutorial, you must have a basic understanding of Model First Mapping.

Suppose, you are doing a Model First Mapping, and you have an entity named Product. The Id property is the primary key for the Product entity. Set the Identity Mechanism for the Product entity to DatabaseServerCalculated, the Identity Mechanism Member is automatically set to Id.

When you create your database by using the Update Database from Model Wizard, the Id column will be the primary key for the Product table and it will be an auto-incremental column.

Composite Identity

In case your class has Composite Identity, you will have to manually specify which one of the identity members will be handled by the Identity Mechanism using the Identity Mechanism Member drop-down list.