AutoIncrementAttribute [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 fields that are auto incremented on server side, e.g. identity columns, or columns using a generator.

Note: the IdentityAttribute is a combination of PrimaryKey, AutoIncrement and NotNull flags, then in the fields that have Identity attribute is not necessary add this attribute.

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

See also: