The following:
class Foo { }
class Bar : Foo { }
var prm = Parameter(typeof(Foo));
var selector = $"as(@0)";
var parser = new ExpressionParser(new[] { prm }, selector, new object[] { typeof(Bar) }, ParsingConfig.Default);
var expr = parser.Parse(null);
fails with:
System.Linq.Dynamic.Core.Exceptions.ParseException: 'The 'as' function requires one argument which is not null.'
The same happens with is:
var selector = $"is(@0)";
It might be helpful to clarify the error by explaining that the one argument must be the FullName of the type.
But I suggest it be possible to accept a System.Type, and FullName should be read from the type.
The following:
fails with:
The same happens with
is:It might be helpful to clarify the error by explaining that the one argument must be the
FullNameof the type.But I suggest it be possible to accept a
System.Type, andFullNameshould be read from the type.