IdentityAttribute [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]

This is a combination of PrimaryKey, AutoIncrement and NotNull flags, which is common for identity columns.

public sealed class CustomerRow : Row, IIdRow, INameRow
{
   [DisplayName("ID"), Identity]
   public Int32? ID
   {
      get { return Fields.ID[this]; }
      set { Fields.ID[this] = value; }
   }