I\'m currently working with ASP Dynamic Data for the first time and I\'m trying to build a filter. Our users have a need to locate items in a list based upon whether or not
There are two problems in your code:
IEnumerable
, when it should be just int
.So, the fixed code is:
var callExpression = Expression.Call(
typeof(Enumerable), "Contains", new[] { typeof(int) }, me, ce);
But it seems all the parts of your expression are not actually dynamic, so maybe something like that following would work too:
Expression> expression =
s => s.RouteIds.Contains(int.Parse(this.ddlRouteNames.SelectedValue));