FindColumn by Column-Name

For this:

csCustFldMain = 'MainId';

  TEntityCustFld = class(TBaseCustFld)
    [JoinColumn(csCustFldMain, [TColumnProp.Unique, TColumnProp.Required])]
    FParentEntity: Proxy<TParentEntity>;
    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


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


  for C in EntityType.AllColumns do
    if SameText(C.Optimization.MemberName, PropName) or SameText(C.Name, PropName) then

and also for // If not found, find fields ...
It could work for declared Names by using Column, JoinColumn, ... Attribute.

As an ORM, Aurelius abstracts the underlying database and allows the user to work with the objects. So it doesn't make much sense to use the "low-level" column names as if they were properties of the object. Conceptually, you are querying objects, not tables.

But you can achieve what you want this way:

  .Where(Linq.Sql<Integer>('A.MainId = ?'), someValue)

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.