AyCode.Blazor/AyCode.Blazor.Components/Services/ExpressionHelpers
Loretta 85dbb853c7 Update ToonTests to serialize type metadata only
Replaced AcToonSerializer.Serialize with SerializeTypeMetadata<FullProcessModel> in ToonTests. The test now serializes only the type metadata for FullProcessModel using the domain description, rather than serializing the actual data instance. Assertions and comments remain unchanged.
2026-03-28 17:25:12 +01:00
..
AcExpressionDeserializer.cs Add LINQ Expression JSON serialization & SignalR grid source 2025-12-30 19:29:50 +01:00
AcExpressionHelper.cs Add LINQ Expression JSON serialization & SignalR grid source 2025-12-30 19:29:50 +01:00
AcExpressionNode.cs Add LINQ Expression JSON serialization & SignalR grid source 2025-12-30 19:29:50 +01:00
AcExpressionSerializerVisitor.cs Add LINQ Expression JSON serialization & SignalR grid source 2025-12-30 19:29:50 +01:00
README.md Update ToonTests to serialize type metadata only 2026-03-28 17:25:12 +01:00

README.md

ExpressionHelpers

LINQ expression tree serialization and deserialization to JSON, enabling expression transport over SignalR or HTTP. Converts Expression trees to a recursive AcExpressionNode DTO and back, supporting binary, unary, lambda, member access, method calls, conditionals, new/member-init, and array expressions.

Key Files

  • AcExpressionNode.cs -- Universal DTO representing any expression node. Includes ParameterNode and MemberBindingNode supporting types. Recursively models the full expression tree and is JSON-serializable.
  • AcExpressionHelper.cs -- Static facade for serializing/deserializing expressions and IQueryable query trees. Provides ExpressionToJson, ExpressionFromJson, QueryToJson, and ApplyQueryFromJson methods.
  • AcExpressionSerializerVisitor.cs -- ExpressionVisitor subclass that walks an expression tree and builds the AcExpressionNode graph using a stack-based approach. Handles closure variable evaluation and constant serialization.
  • AcExpressionDeserializer.cs -- Reconstructs Expression trees from AcExpressionNode DTOs. Resolves types, parameters, methods, and member bindings. Handles nullable type mismatches in binary expressions.

LLM Maintenance: If you modify code in this folder, update this README to reflect the changes. If you notice the README content does not match the current code, automatically update the README to match the code.