Currently, the Dynamic LINQ writer/visitor outputs a simple string. This means:
it cannot be copied/pasted directly without potential modification: specifically, string literal and char literal escaping
we can't display Dynamic LINQ method calls, even though all they do is transform the expression tree
For example:
// using System.Dynamic.Linq.Core;
public c;lass Person {
public string LastName {get;set;}
}
var expr = Enumerable.Empty<Person>().AsQueryable().Where("LastName = \"A\"").Expression;
Console.WriteLine(expr.ToString("Dynamic LINQ"));
prints an error, because the call to .Where is not valid within a selector, and thus not renderable.
Currently, the Dynamic LINQ writer/visitor outputs a simple string. This means:
For example:
prints an error, because the call to
.Where
is not valid within a selector, and thus not renderable.Ideally, we'd like to see this:
which shows the Dynamic LINQ method calls, and can be copied/pasted much more easily.
This would require knowledge of the language (C# / VB) for rendering string literals.
Related: #78,