ExpressionToString
ExpressionToString copied to clipboard
Extension method
Originally we would have written something like this:
Expression<Action> func = () => Console.WriteLine();
string result = func.ToString();
I would like for ExpressionToString to offer an extension method. The method name ToString is taken. Maybe call the extension method something like:
ToReadableStringToAwesomeStringToSafeStringToStringSafeToTextToStringDumpGetStringAsStringAsString
(Naming things is hard)
I can do this if you want it.
This is why I released this as < v1. I thought about this too =)
.ToCodeString() maybe.
I am not particularly attached to any name (although I think the name should start with the word To for IntelliSense discoverability purposes).
Which name do you like the most? ToCodeString is fine in my opinion.
We could also be compatible with https://github.com/jbevain/mono.linq.expressions/#api
Ah. If I understand correctly, you want to call the extension method ToCSharpCode so users can swap out mono.linq.expressions for (the lighter) ExpressionToString with ease?
Unsure, will have a think. Just put it here as an option..