PrimaryKeyAttribute [Mapping]

Estrusco edited this page Apr 26, 2016 · 1 revision
Clone this wiki locally

(from the official guide)

[namespace: Serenity.Data.Mapping] - [assembly: Serenity.Data]

Set this for primary key fields in table.

Primary key fields are selected on Key column selection mode in List and Retrieve request handlers.

public sealed class CustomerRow : Row, IIdRow, INameRow
{
   [PrimaryKey]
   public String CustomerID
   {
      get { return Fields.CustomerID[this]; }
      set { Fields.CustomerID[this] = value; }
   }

See also: