All Projects → agileobjects → Readableexpressions

agileobjects / Readableexpressions

Licence: mit
A .NET 3.5+ and .NET Standard 1.0 library and set of Debugger Visualizers which translate Expression Trees into readable C# source code

Projects that are alternatives of or similar to Readableexpressions

Fatturaelettronica.net
Fattura Elettronica per le aziende e la Pubblica Amministrazione Italiana
Stars: ✭ 148 (-37.55%)
Mutual labels:  netstandard
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (-31.65%)
Mutual labels:  netstandard
Avaloniaedit
Avalonia-based text editor (port of AvalonEdit)
Stars: ✭ 201 (-15.19%)
Mutual labels:  netstandard
Fluentdispatch
🌊 .NET Standard 2.1 framework which makes easy to scaffold distributed systems and dispatch incoming load into units of work in a deterministic way.
Stars: ✭ 152 (-35.86%)
Mutual labels:  netstandard
Ffmediatoolkit
FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
Stars: ✭ 156 (-34.18%)
Mutual labels:  netstandard
Binarypack
The fastest and most memory efficient binary serialization library for .NET Standard 2.1, powered by dynamic IL generation
Stars: ✭ 169 (-28.69%)
Mutual labels:  netstandard
Eventflow
Async/await first CQRS+ES and DDD framework for .NET
Stars: ✭ 1,932 (+715.19%)
Mutual labels:  netstandard
Opentouryo
”Open棟梁”は、長年の.NETアプリケーション開発実績にて蓄積したノウハウに基づき開発した.NET用アプリケーション フレームワークです。 (”OpenTouryo” , is an application framework for .NET which was developed using the accumulated know-how with a long track record in .NET application development.)
Stars: ✭ 233 (-1.69%)
Mutual labels:  netstandard
Vulkancore
Vulkan 1.0 graphics and compute API bindings for .NET Standard
Stars: ✭ 162 (-31.65%)
Mutual labels:  netstandard
Oxyplot
A cross-platform plotting library for .NET
Stars: ✭ 2,466 (+940.51%)
Mutual labels:  netstandard
Weihanli.common
common tools,methods,extension methods etc... .net 常用工具类,公共方法,常用扩展方法等,基础类库
Stars: ✭ 152 (-35.86%)
Mutual labels:  netstandard
Osharp
OSharp是一个基于.NetCore的快速开发框架,框架对 AspNetCore 的配置、依赖注入、日志、缓存、实体框架、Mvc(WebApi)、身份认证、功能权限、数据权限等模块进行更高一级的自动化封装,并规范了一套业务实现的代码结构与操作流程,使 .Net Core 框架更易于应用到实际项目开发中。
Stars: ✭ 2,151 (+807.59%)
Mutual labels:  netstandard
Anclafs
ASP.NET Core Library and Framework Support
Stars: ✭ 192 (-18.99%)
Mutual labels:  netstandard
Peachpie
PeachPie - the PHP compiler and runtime for .NET and .NET Core
Stars: ✭ 1,945 (+720.68%)
Mutual labels:  netstandard
Swan
Swan stands for Stuff We All Need. Unosquare's collection of C# extension methods and classes.
Stars: ✭ 202 (-14.77%)
Mutual labels:  netstandard
Ether.network
https://github.com/Eastrall/Sylver
Stars: ✭ 147 (-37.97%)
Mutual labels:  netstandard
Fastenum
The world fastest enum utilities for C#/.NET
Stars: ✭ 165 (-30.38%)
Mutual labels:  netstandard
Pcqq Protocol
PCQQ协议 机器人
Stars: ✭ 237 (+0%)
Mutual labels:  netstandard
Asyncfriendlystacktrace
Async-friendly format for stack traces and exceptions
Stars: ✭ 205 (-13.5%)
Mutual labels:  netstandard
Netprints
Visual programming for .NET inspired by Unreal Engine's Blueprints
Stars: ✭ 194 (-18.14%)
Mutual labels:  netstandard

ReadableExpressions

NuGet

ReadableExpressions is set of Debugger Visualizers and a NuGet-packaged extension method for readable, source-code versions of Expression Trees.

Debugger Visualizers

An installer for the Expression Debugger Visualizers can be downloaded from the Visual Studio Gallery.

The visualizer has both Light and Dark themes:

[Visualizer themes]

...and output can be customised using various options:

[Visualizer options]

ASP.NET Core 5 Known Issue

.NET 5 has a breaking change, which disables BinaryFormatter serialization by default. This causes issues with the ReadableExpressions visualizers (and elsewhere) when debugging ASP.NET Core apps as the VS debugger uses BinaryFormatter to serialize objects before sending them to the visualizer.

The solution is to enable the BinaryFormatter in Debug only by adding the following to your ASP.NET Core csproj:

<PropertyGroup>
  <TargetFramework>net5.0</TargetFramework>
  <EnableUnsafeBinaryFormatterSerialization Condition=" '$(Configuration)' == 'Debug' ">
    true
  </EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

NuGet Package

The extension method is available in a NuGet package targeting .NETStandard 1.0+ and .NET 3.5+:

PM> Install-Package AgileObjects.ReadableExpressions

...and is used like so:

using AgileObjects.ReadableExpressions;

string readable = myExpression.ToReadableString();

...it also works on DynamicLanguageRuntime expressions.

Options

To include namespaces when outputting type names, use:

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

To use full type names instead of var for local and inline-declared output parameter variables, use:

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

To declare output parameter variables inline with the method where they are first used, use:

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

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

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

To show implicitly-typed array type names, use:

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

To show lambda parameter type names, use:

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

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

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

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 specify a custom string for code indenting, use:

string readable = myExpression
    .ToReadableString(c => c.IndentUsing("\t"));
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].