[PrimaryKey(PrimaryKeyType.Counter, "Counters", "Name = 'HeaderTable'", "Current")] public int Key;
This declares a primary key that gets the values from the Counters column Current with Name = HeaderTable .
[Relation("Key")] public int HeaderKey;
This declares a field, depending on the Parent-Object Key , so that the field automatically gets the value of the referenced column.
[NotMapped] public string RefTableKey = "10-Wert";
This declares a non-mapped field in the database. It is ignored while writing.
[LookupReference(LookupType.Optional, "RefTable", "Id", "LookupValue = @RefTableKey")] public int RefTableRef;
This allows you to fill the reference from another table into the database. In this case, we look in RefTable for the column Id where LookupValue = Context of a local field name RefTableKey .