ReadableExpressions
ReadableExpressions copied to clipboard
implement override dictionary for translations to expose to consumers
I am in need of the ability to override the translation you've implemented for specific Expression types. I'm exploring metaprogramming via ast -> expression trees -> sourcecode that would essentially be put into a .cs file. The following is probably not the implementation you'd want as maintainer. Please take a look and consider adding this functionality to ReadableExpressions. If the ITranslation required a static param for NodeType I wouldn't need to create an instance in order to add to the dictionary. I'm not sure how to get around the expression tree needed for the ctor. Please consider.. Thanks!
expr.ToReadableString(x =>
{
return x.ShowLambdaParameterTypes.OverrideTranslations(new[] { typeof(NewLambdaTranslation) });
})