-
Notifications
You must be signed in to change notification settings - Fork 806
Entity Framework IdentityAttribute [Mapping]
Victor Tomaili edited this page May 3, 2021
·
1 revision
(from the official guide)
[namespace: Serenity.Data.Mapping] - [assembly: Serenity.Data]
This is a combination of [PrimaryKey](FieldFlags Enumeration##primarykey-flag-see-primarykeyattribute), AutoIncrement and [NotNull](FieldFlags Enumeration#notnull-flag-see-notnullattribute) 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; }
}
Copyright © Serenity Platform 2017-present. All rights reserved.
Documentation | Serene Template | Live Demo | Premium Support | Issues | Discussions