Hi @Farias_Anderson Thank you for your help. I looked into the Dictionary approach.
I primarily use CodeFirst (not using Data Modeler much), and find the "Dictionary" approach cumbersome, and that it doesn't meet my need and personal preference.
I ended up doing the following, adding all column names to the const section manually. This way:
- I can reference the column name elsewhere directly by
- Does not add much extra coding effort with CodeFirst
- All the relevant information at one single place, i.e., where the entity class is defined.
TRole = class
_RoleKey = 'ROLE_KEY';
_Description = 'DESCRIPTION';
[Column(_RoleKey, [TColumnProp.Unique, TColumnProp.Required], 32)]
property Id: Integer read FId write FId;
property RoleKey: string read FRoleKey write FRoleKey;
property Description: Nullable<string> read FDescription write FDescription;