Section navigation

Public structRead-only LeanExpressionVisitor

Namespace
Rowles.LeanCorpus.Linq
Assembly
Rowles.LeanCorpus.dll

Translates a LINQ Expression tree — typically an Expression<Func<TDocument, bool>> — into a LeanCorpus Query tree suitable for Search(Query, int).

public readonly struct LeanExpressionVisitor

Remarks

The struct is allocated on the stack; the returned Query objects are the only heap allocations in the translation path. Field lookups are delegated to a Func<T, TResult> that is expected to be a source-generator-emitted switch expression (JIT-compiled to a jump table, zero allocation).

Public constructor LeanExpressionVisitor(Func<string, IFieldDescriptor?>?)

Initialises a new LeanExpressionVisitor.

Public method Translate(Expression)

Translates an expression tree into a Query.