Skip to content

A .NET Standard 1.0 library and set of Debugger Visualizers which translate expression trees into readable code

License

Notifications You must be signed in to change notification settings

rikimaru0345/ReadableExpressions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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.

About

A .NET Standard 1.0 library and set of Debugger Visualizers which translate expression trees into readable code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%