Readonly property of entity and comparison in a query

  LDocument := FManager.Find<TDocument>
    .Where(Linq['KeyFilename'] = AFile)
    .UniqueResult;

In the code above, why it doesn't work when KeyFilename is a readonly property of the entity TDocument ?

Please provide the full mapping of the class and explain what do you mean by "it doesn't work".

Hi Wagner,

It is written on the page 164 of the last book of Holger. I haven't tested it yet because i follow this book step by step.

It's a calculated property at Delphi class level (through TDocument.GetKeyFilename - pages 84 & 163), so it can't be used as a query filter condition (this is explained on the same page 164) once it doesn't exist at database level.
It's not mapped. Please see the last highlighted sentence on page 82.

1 Like

Hi Julio,
thank you for your reply. I will check it in few days because i haven't the book with me.