Skip to content
A .NET Standard 1.0 library and set of Debugger Visualizers which translate expression trees into readable code
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NuGet
ReadableExpressions.UnitTests.Net35
ReadableExpressions.UnitTests
ReadableExpressions.Visualizers.Core
ReadableExpressions.Visualizers.Installer.Custom
ReadableExpressions.Visualizers.Installer
ReadableExpressions.Visualizers.Vs10
ReadableExpressions.Visualizers.Vs11
ReadableExpressions.Visualizers.Vs12
ReadableExpressions.Visualizers.Vs14
ReadableExpressions.Visualizers.Vs15
ReadableExpressions.Visualizers.Vs16
ReadableExpressions
.gitattributes
.gitignore
AgileObjects.ReadableExpressions.Visualizers.Vs10.dll
AgileObjects.ReadableExpressions.Visualizers.Vs11.dll
AgileObjects.ReadableExpressions.Visualizers.Vs12.dll
AgileObjects.ReadableExpressions.Visualizers.Vs14.dll
AgileObjects.ReadableExpressions.Visualizers.Vs15.dll
AgileObjects.ReadableExpressions.Visualizers.Vs16.dll
AgileObjects.ReadableExpressions.Visualizers.msi
CommonAssemblyInfo.cs
LICENSE.md
NextVersion.txt
NuGetPack.bat
README.md
ReadableExpressions.sln
ReadableExpressions.sln.DotSettings
ReadableExpressions.snk
VersionInfo.cs

README.md

ReadableExpressions

NuGet

ReadableExpressions is an extension method for the Expression class and set of Debugger Visualizers to produce readable, source-code string versions of Expression Trees. It targets .NETStandard 1.0+ and .NET 3.5+.

Usage

The extension method (in the namespace AgileObjects.ReadableExpressions) is used like so:

string readable = myExpression.ToReadableString();

...it also works on DynamicLanguageRuntime expressions.

Options

To maintain explicit generic arguments on method calls where they are implied, use:

string readable = myExpression
    .ToReadableString(c => c.UseExplicitGenericParameters);

To include namespaces when outputting Type names, use:

string readable = myExpression
    .ToReadableString(c => c.UseFullyQualifiedTypeNames);

To define a custom factory for naming anonymous types, use:

string readable = myExpression
    .ToReadableString(c => c.NameAnonymousTypesUsing(
        anonType => GetAnonTypeName(anonType)));

To define a custom factory for translating ConstantExpression values, use:

string readable = myExpression
    .ToReadableString(c => c.TranslateConstantsUsing(
        (constantType, constantValue) => GetConstantValue(constantType, constantValue)));

To output a source code comment when a lambda is 'quoted', use:

string readable = myExpression
    .ToReadableString(c => c.ShowQuotedLambdaComments);

Debugger Visualizers

An installer for a set of Debugger Visualizers which use the extension method for Expressions can be downloaded from the Visual Studio Gallery.

Download

You can download and install using the NuGet package, or clone the repository on GitHub.

You can’t perform that action at this time.