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 TRole._RoleKey
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.
Unfortunately that's the only way to do so. That's a limitation of Delphi/Pascal language itself, since, for now, it doesn't provide a kind of "property reference" mechanism - or lambda expressions.
As a side note, keep in mind that when using Linq you work with the objects, thus it expects property and field names, not database column names. If your property is named RoleKey, it doesn't matter how it's named in the database, you should use