public IPrimaryKeyDef MapIdentity()
{
var classDef = this.ClassDef;
var primaryKeyDef = GetPrimaryKeyDef(classDef);
if (primaryKeyDef == null)
{
var propDef = GetPrimaryKeyPropDef();
if (propDef == null) return null;
var keyDef = new PrimaryKeyDef {propDef};
keyDef.IsGuidObjectID = IsGuidObjectID(propDef);
classDef.PrimaryKeyDef = keyDef;
}
return classDef.PrimaryKeyDef;
}