csCustFldMain = 'MainId'; [Entity] TEntityCustFld = class(TBaseCustFld) private [JoinColumn(csCustFldMain, [TColumnProp.Unique, TColumnProp.Required])] FParentEntity: Proxy<TParentEntity>; ... public ParentEntity: TParentEntity; ...
It does not work to query the Data by using:
Find<TEntityCustFld>.Where(Linq[csCustFldMain] = someValue).UniqueResult;
That's what I expected from the documents
Linq[<propertyname>] Note that in all the methods listed here, the method can receive a string (representing a property name) or a projection. See TProjections.Prop for more details.
But stepping into the EPropertyNotFound-Error I get, I think it might be possible, if
would find Optimizations by C.Name
so if you would change:
for C in EntityType.AllColumns do if SameText(C.Optimization.MemberName, PropName) then Exit(C);
for C in EntityType.AllColumns do if SameText(C.Optimization.MemberName, PropName) or SameText(C.Name, PropName) then Exit(C);
and also for // If not found, find fields ...
It could work for declared Names by using Column, JoinColumn, ... Attribute.