Is there a way to get (or set) a property value while giving it's name. A thing similar to Dataset.FieldByName(afieldname).Value ?
I guess this could be done with RTTI but how does Tnullable<> properties kind behave ?
Value := Manager.Explorer.GetMemberValue(Object, RttiInfo); Manager.Explorer.SetMemberValue(Object, RttiInfo, Value);
Info := Manager.Explorer.GetOptimization(TMyEntity, 'PropName'); // You should later destroy Info object!
Wagner R. Landgraf2018-03-02 15:06:43
// For primitive types: Info := Manager.Explorer.GetColumnByPropertyName(TMyEntity, 'PropName').Optimization; // For instance (association) types: Info := Manager.Explorer.GetAssociationByPropertyName(TMyEntity, 'AssocPropName').Optimization; // No need to destroy Info objects in this case
Thank you Landgraf.
Hi, the code I provided is a direct, compact code. But I suggest you break it into pieces and check each step, especially because you are trying it for the first time.