Skip to content
pagebrooks edited this page Dec 7, 2011 · 4 revisions

The KeyType enum allows Dapper Extensions to know how to populate the primary key for your POCOs. The following KeyTypes are available:

public enum KeyType
{
    NotAKey,
    Identity,
    Guid,
    Assigned
}

NotAKey

Any property that is not a primary key will be mapped with this enum value.

Identity

Any primary key that is an Integer will be mapped with this enum value. This value instructs Dapper Extensions to allow the database to generate the next available Id.

Guid

Any primary key that is an Guid will be mapped with this enum value. This value instructs Dapper Extensions to generate a new Guid for the POCO before database insertion. Dapper Extensions generates COMB Guids (see: GetNextGuid)

Assigned

Any primary key that is not a Guid or Integer will mapped with this enum value. This value instructs Dapper Extensions to not generate a key before database insertion. Furthermore, Dapper Extensions will not obtain a key from the database after insertion. In other words, it is up to the developer to supply a key.

Clone this wiki locally