Tengo una clase simple con una propiedad int llamada Int:
public class TestObject
{
public int Int { get; set; }
}
y wherePredicate "Int> = 90"
Cuando intento usarlo con un IQueryable.Where (wherePredicate) se produce el error: System.Linq.Dynamic.Core.Exceptions.ParseException: '.' o '(' o literal de cadena esperado
Cuando cambio wherePredicate a "It.Int> = 90", funciona como se esperaba.
Int
es una palabra clave reservada.
Use un nombre de propiedad diferente:
void Main()
{
var l = new List<TestObject>();
var q = l.AsQueryable();
var result = q.Where("X >= 90");
result.Dump(); // LINQPad
}
public class TestObject
{
public int X { get; set; }
}