eQuantic.Linq.Expressions 3.7.1

dotnet add package eQuantic.Linq.Expressions --version 3.7.1
                    
NuGet\Install-Package eQuantic.Linq.Expressions -Version 3.7.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="eQuantic.Linq.Expressions" Version="3.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="eQuantic.Linq.Expressions" Version="3.7.1" />
                    
Directory.Packages.props
<PackageReference Include="eQuantic.Linq.Expressions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add eQuantic.Linq.Expressions --version 3.7.1
                    
#r "nuget: eQuantic.Linq.Expressions, 3.7.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package eQuantic.Linq.Expressions@3.7.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=eQuantic.Linq.Expressions&version=3.7.1
                    
Install as a Cake Addin
#tool nuget:?package=eQuantic.Linq.Expressions&version=3.7.1
                    
Install as a Cake Tool

eQuantic.Linq.Expressions

Convert any .NET expression tree into a fully structured, serialization-friendly model (JSON) — and rebuild the exact expression back, with full fidelity.

Expression<Func<Order, bool>>  ⇄  ExpressionNode model  ⇄  JSON
  • 84 of 85 ExpressionType values round-trip with structural fidelity (only Dynamic is impossible by design) — binaries, unaries, calls, members, initializers, anonymous types, blocks, loops, switch, try/catch, labels and gotos.
  • The complete Queryable surface (all 63 operators on .NET 10, including LeftJoin, CountBy, AggregateBy, Shuffle) serialized as whole IQueryable pipelines — query root included, re-bindable on the other side.
  • Closures handled: captured locals, this references and compiler display classes fold into portable constants before serialization.
  • Anonymous types travel: projections are described structurally and re-materialized with matching equality semantics (safe for GroupBy/Distinct keys).
  • Targets netstandard2.0, net8.0 and net10.0.

Quick start

using eQuantic.Linq.Expressions;

Expression<Func<Order, bool>> filter = o => o.Total > minimum && o.Items.Any(i => i.Price > 50m);

string json = ExpressionSerializer.Default.ToJson(filter);
// …transport, store, audit…
var rebuilt = ExpressionSerializer.Default.FromJson<Func<Order, bool>>(json);

The typed model — ExpressionModel<TRoot>

Anchor the payload on a root entity and everything below it is inferred — parameter types, member owners, constant types, generic method arguments. Payloads become lean enough to write by hand:

{
  "body": {
    "$type": "binary",
    "nodeType": "GreaterThan",
    "left":  { "$type": "member", "member": { "name": "total" }, "expression": { "$type": "parameter" } },
    "right": { "$type": "constant", "value": 100 }
  }
}
Expression<Func<Order, bool>> predicate = ExpressionModel<Order>.FromJson(json).ToPredicate();

Member and method names match case-insensitively (including [Column("…")] fallback), enum constants accept strings, and instance-style extension calls (items.Any(…)) are bound by generic unification.

DTO → entity casting

Rewrite expressions authored over the API shape onto the data model — with computed mappings:

using eQuantic.Linq.Expressions.Casting;

var cast = ExpressionCast.Create<OrderDto, Order>(o => o
    .Map(d => d.CustomerName, e => e.Customer.Name)
    .Map(d => d.Revenue, e => e.Items.Sum(i => i.Price * i.Quantity))
    .Nested<ItemDto, OrderItem>(n => n.Map(i => i.Cost, e => e.Price)));

Expression<Func<Order, bool>> where = cast.Predicate(dtoPredicate);

Composition & helpers

Provider-friendly predicate composition (parameters rebound — no Invoke), member-path bridging and model-direct querying:

var filter = PredicateBuilder.True<Order>()
    .AndAlso(o => o.Total > 100m)
    .AndAlso(o => o.Customer.IsVip);            // also Or/OrElse/Not/Compose

var path     = selector.GetMemberPath();                                // o => o.Customer.Name → "Customer.Name"
var back     = MemberPathExtensions.ToSelector<Order>("customer.name"); // string path → typed lambda

db.Orders.Where(model)                           // ExpressionModel<Order> straight onto IQueryable
         .OrderByPath("customer.name").ThenByPath("total", descending: true);

NullGuards.Apply(predicate) (or predicate.WithNullGuards()) rewrites deep member chains with C# ?.-style protection for LINQ-to-objects execution.

Security & performance

  • One-liner hardening for untrusted payloads: ExpressionSerializer.CreateSecure(typeof(Order), …) — strict type resolution locked to your contract types, a method allow-list, and tightened depth/node/anonymous-type caps. Fine-grained policies via TypeResolutionOptions and MethodFilter.
  • Nothing executes at deserialization time — decoding only resolves types/members and assembles an inert tree.
  • Process-wide reflection caches, interpreter-based closure folding, compiled anonymous-type accessors and deterministic overload binding keep hot paths reflection-free and reproducible.

Learn more

Educational guides (concepts, hand-written payloads, internals, FAQ): getting started · the model & inference · DTO casting · security · extensions · how it works

MIT © eQuantic Tech

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on eQuantic.Linq.Expressions:

Package Downloads
eQuantic.Core.Data

eQuantic Core Data Class Library

eQuantic.Linq

The eQuantic.Linq engine as a single reference: a meta-package that brings in eQuantic.Linq.Expressions (expression ⇄ JSON serialization, inference, casting), eQuantic.Linq.Web (query-string syntax and typed builders) and eQuantic.Linq.Specification (the specification pattern). Framework-free core — the ASP.NET Core / Swagger / OpenAPI integrations remain opt-in packages.

eQuantic.Core.Data.MongoDb

Native MongoDB implementation of the eQuantic.Core.Data contracts — the MongoDB Driver directly, no Entity Framework, with first-class document-store migrations.

eQuantic.Linq.Web

REST-friendly query-string syntax for eQuantic.Linq.Expressions: parse filters (property:op(value), and/or/not, any/all, aggregates, method segments), sorting, paging and anonymous projections from URLs into fully typed LINQ expression trees — with DTO→entity casting support.

eQuantic.Linq.Specification

Specification pattern for LINQ: composable specifications (And/AndAlso/Or/OrElse/Not with expression parameter rebinding, operator overloads) plus ExpressionModelSpecification, which materializes serialized eQuantic.Linq.Expressions models — or their raw JSON — into typed predicates.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.7.1 0 7/21/2026
3.7.0 290 7/19/2026
3.6.0 116 7/19/2026
3.5.0 116 7/19/2026
3.4.0 116 7/19/2026
3.3.0 118 7/19/2026
3.2.1 159 7/18/2026
3.2.0 120 7/18/2026
3.1.0 181 7/18/2026
3.0.0 108 7/18/2026

First preview: full-fidelity expression⇄JSON serialization (84/85 ExpressionTypes, all 63 Queryable operators), root-anchored ExpressionModel<TRoot> with type inference, strict type-resolution security, DTO→entity ExpressionCast with computed maps and column fallback.