Hi
In a project I have the need to access some on my entity properties in a dynamic way. This requirement is not because of unkown fields during compile time, but to access known columns in a dynamic way, for example using something like MyEntity.PropByName('name').AsString (similar to FieldByName of TDataset).
For example I have the following column declaration:
I want to be able access this column like MyObject.PropByName('FIRST_NAME')
My current solution is that I am using TAureliusDataset to access FIRST_NAME.
Granted, you will have a little more work to handle Aurelius specific types like Nullable<T> and Proxy<T>. In this case you also have the option to use the entity meta information. It's not documented but here is more or less what you can use:
Thanks,
Does Prop.Columns[0] have a special meaning here? Or should I call Find to correct column?
var Entity := FManager.Explorer.FindEntityTypeFromClass(ChatContext.ClassType);
var Prop := Entity.Properties.Find(FieldName);
var Column := Prop.Columns.Find(FieldName);
Column.Wrapper.SetDBValue(ChatContext, Value);