pauldeen79.ExpressionFramework.Parser 0.7.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package pauldeen79.ExpressionFramework.Parser --version 0.7.4                
NuGet\Install-Package pauldeen79.ExpressionFramework.Parser -Version 0.7.4                
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="pauldeen79.ExpressionFramework.Parser" Version="0.7.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add pauldeen79.ExpressionFramework.Parser --version 0.7.4                
#r "nuget: pauldeen79.ExpressionFramework.Parser, 0.7.4"                
#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.
// Install pauldeen79.ExpressionFramework.Parser as a Cake Addin
#addin nuget:?package=pauldeen79.ExpressionFramework.Parser&version=0.7.4

// Install pauldeen79.ExpressionFramework.Parser as a Cake Tool
#tool nuget:?package=pauldeen79.ExpressionFramework.Parser&version=0.7.4                

ExpressionFramework

Evaluates expressions.

Example:

var expression = new FieldExpression("Name");
var context = new { Name = "Hello world!" };
var result = expression.Evaluate(context).Value;
// generates: Hello world!

See unit tests for more examples.

Code generation

I am currently not storing generated files in the code repository. To generate, simply run the console project from either Visual Studio (hit F5) or a command prompt. This will replace almost all generated code.

There are some files (evaluatables, expressions, operators and aggregators) being generated for the first time only. This is known as code scaffolding, which happens when you add a new evaluatable, expression, operator or aggregator type.

Code generation

I am currently not storing generated files in the code repository. To generate, you have to trigger the code generation tool from either Visual Studio (hit F5) or a command prompt. This will replace all generated code.

I am using t4plus, which is a dotnet global tool, so it can run on all environments. The models and code generation are stored in an assembly which is also added to the solution. Note that there is no project reference to this project, it is only needed at build time.

At this moment, I am not using automatic code generation after changing code generation models or providers. This can be enabled, but is a bit cumbersome in build pipelines. First, the file system isn't updated fast enough, so the build will not succeed on a fresh cloned instance. Second, Sonar runs the post build command in a Docker image, and this image doesn't know how to load the code generation tool. Because of these problems, I have commented the post build event. You may uncomment it if you find yourself constantly re-generating stuff.

Command to install t4plus:

dotnet tool install --global pauldeen79.TextTemplateTransformationFramework.T4.Plus.Cmd --version 0.2.5

Command to build code generation project (example where you are in the root directory):

dotnet build -c Debug src/ExpressionFramework.CodeGeneration/ExpressionFramework.CodeGeneration.csproj

Command to run code generation (example where you are in the root directory):

Invoke-Expression "t4plus assembly -a $(Resolve-Path "src/ExpressionFramework.CodeGeneration/bin/Debug/net7.0/ExpressionFramework.CodeGeneration.dll") -p $(Resolve-Path "src") -u $(Resolve-Path "src/ExpressionFramework.CodeGeneration/bin/Debug/net7.0")"

Note that the -a argument of the t4plus assembly command currently requires a fully qualified path to the code generation assembly.

You can use the following post build event in the code generation project to run it automatically after changing code generation models or providers:

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
  <Exec Command="t4plus assembly -a $(TargetDir)ExpressionFramework.CodeGeneration.dll -p $(TargetDir)../../../../ -u $(TargetDir)" />
</Target>

Note that if you use a post build event, this will cause SonarCloud to fail because t4plus is not available in the docker image where the code analysis runs. To fix this, you need the following PowerShell script:

((Get-Content -path src/ExpressionFramework.CodeGeneration/ExpressionFramework.CodeGeneration.csproj -Raw) -replace 't4plus','echo') | Set-Content -Path src/ExpressionFramework.CodeGeneration/ExpressionFramework.CodeGeneration.csproj
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 was computed.  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. 
.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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.1 105 11/20/2024
0.9.0 110 11/17/2024
0.8.0 82 11/3/2024
0.7.12 83 10/30/2024
0.7.11 108 10/18/2024
0.7.10 97 10/18/2024
0.7.9 98 9/21/2024
0.7.8 97 9/21/2024
0.7.7 145 9/11/2024
0.7.6 89 9/8/2024
0.7.5 211 5/9/2024
0.7.4 79 5/3/2024
0.7.3 75 5/3/2024
0.7.2 66 5/2/2024
0.7.1 140 4/17/2024