Is that a lambda? If not, what is it?

A few days ago, I tried to use the new ORM for delphi from Devart, which was called EntityDAC, and I read the documents specific to the LINQ part when I saw something like:

Linq.From(Emp).Where(Emp['Sal'] > 1000) 

said he woke me the first time he saw me. the expression "Emp ['Sal']> 1000" is not a lambda expression ?! since the trial version of this component does not come with sources, I could not understand how the function / procedure is declared.

link: http://www.devart.com/entitydac/docs/ → Linq Queries → Linq Syntax → Scroll down to Where session

+7
orm delphi devart
source share
1 answer

I mentioned this on my blog a few months ago. I have no source to view, but it is almost certainly done as follows:

  • The expression Emp['Sal'] returns a value of type record
  • Operator Overload Messages Detected in This Record
  • The Delphi language defines operator overloads as functions and does not require them to return any particular or intuitive type. Therefore, the > operator here does not return a logical, but rather a different record.
  • By linking these operators, you can create an expression tree that can be evaluated by their LINQ evaluator.
+12
source share

All Articles