![]() |
VOOZH | about |
dotnet add package Linq.Expression.Optimizer --version 1.0.39
NuGet\Install-Package Linq.Expression.Optimizer -Version 1.0.39
<PackageReference Include="Linq.Expression.Optimizer" Version="1.0.39" />
<PackageVersion Include="Linq.Expression.Optimizer" Version="1.0.39" />Directory.Packages.props
<PackageReference Include="Linq.Expression.Optimizer" />Project file
paket add Linq.Expression.Optimizer --version 1.0.39
#r "nuget: Linq.Expression.Optimizer, 1.0.39"
#:package Linq.Expression.Optimizer@1.0.39
#addin nuget:?package=Linq.Expression.Optimizer&version=1.0.39Install as a Cake Addin
#tool nuget:?package=Linq.Expression.Optimizer&version=1.0.39Install as a Cake Tool
Lightweight optimizer of System.Linq.Expression expressions. Just basic boolean algebra and reductions, constant and tuple/anonymous type eliminations. For side-effect-free Expressions. No compilation-subjective optimizations. This is meant to be used with expressions that are not compiled but transferred to other domains.
Supported frameworks: Net 3.5, Net 4.5-... (and Mono), .NET Standard 1.6 (so also .NET Core)
Example as a quote. There are various other cases also.
3 < 4 -> truenew AnonymousObject(Item1 = x, Item2 = "").Item1 --> xif false then x else y -> ynot(false) -> truea or (b or (c or (d or (e or (f or (g or h)))))) -> ((a or b) or (c or d)) or ((e or f) or (g or h))y = 3 and (y + x) -> (3 + x)5 * 3 -> 15(x or y) and (x or z) -> x or (y and z)false or y -> ytrue or x -> truex and (x or y) -> xy or y -> yx and not(x) -> falsenot(not(y)) -> ynot(x) and not(y) -> not(x or y)This is a side-track from SQLProvider, excellent tool that is kind of OR-mapper with auto-generated objects, so it compiles any databases to .NET-language, and works fast on design time in Visual Studio or other editors.
But I needed better SQL-queries. So this optimises .NET LINQ-expressions. These expressions were not meant to be compiled, so Nessos LinqOptimizer was not the right tool. I thought that .NET would optimize these automatically, but no.
Read the Getting started tutorial to learn more.
Documentation: http://thorium.github.io/Linq.Expression.Optimizer
If you want more optimizations, please feel free to send PRs!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 4 NuGet packages that depend on Linq.Expression.Optimizer:
| Package | Downloads |
|---|---|
|
Dosaic.Plugins.Persistence.EfCore.Abstractions
A plugin-first dotnet framework for rapidly building anything hosted in the web. |
|
|
Dosaic.Plugins.Persistence.EfCore.NpgSql
A plugin-first dotnet framework for rapidly building anything hosted in the web. |
|
|
SpeedyCourse.Entities
Package Description |
|
|
XSpecification.Linq
XSpecification is an implementation of Specification pattern for Linq and Elasticsearch |
Showing the top 3 popular GitHub repositories that depend on Linq.Expression.Optimizer:
| Repository | Stars |
|---|---|
|
rnwood/smtp4dev
smtp4dev - the fake smtp email server for development and testing
|
|
|
scottksmith95/LINQKit
LINQKit is a free set of extensions for LINQ to SQL and Entity Framework power users.
|
|
|
zzzprojects/System.Linq.Dynamic.Core
The .NET Standard / .NET Core version from the System Linq Dynamic functionality.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.39 | 420 | 6/11/2026 |
| 1.0.38 | 157 | 6/9/2026 |
| 1.0.37 | 192 | 6/8/2026 |
| 1.0.36 | 847 | 5/26/2026 |
| 1.0.35 | 4,721 | 4/8/2026 |
| 1.0.34 | 34,860 | 11/9/2025 |
| 1.0.33 | 2,926 | 9/8/2025 |
| 1.0.32 | 2,036 | 6/19/2025 |
| 1.0.31 | 726 | 6/4/2025 |
| 1.0.29 | 13,771 | 3/31/2025 |
| 1.0.28 | 1,715 | 3/26/2025 |
| 1.0.27 | 980 | 3/18/2025 |
| 1.0.24 | 11,942 | 11/7/2024 |
| 1.0.23 | 46,327 | 6/26/2024 |
| 1.0.22 | 634 | 6/26/2024 |
| 1.0.21 | 11,965 | 4/5/2024 |
| 1.0.20 | 689 | 4/2/2024 |
Fixes for some edge cases found