zzzprojects / System.Linq.Dynamic.Core

The .NET Standard / .NET Core version from the System Linq Dynamic functionality.
https://dynamic-linq.net/
Apache License 2.0
1.57k stars 228 forks source link

DynamicExpressionParser.ParseLambda #762

Closed L60008028 closed 11 months ago

L60008028 commented 11 months ago

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

condition = "x.Age > 18 && x.City == New York", var parameter = Expression.Parameter(typeof(T), "x"); var lambda = DynamicExpressionParser.ParseLambda(new[] { parameter }, null, condition);

2. Exception

System.Linq.Dynamic.Core.Exceptions.ParseException:“Type 'York' not found”

condition = "x.Age > 18 && x.City == \"New York\"", is right.

StefH commented 11 months ago

@L60008028 That's correct, you need to provide the text New York as a string, so " are needed.