-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
I am trying to get the following to work:
var rule = Rule.Create("Description", "Contains", "Do");
var expression = MRE.ToExpression<T>(rule);
var retVal = records.AsQueryable()
.Where(expression)
.ToList();where records is a collection of T having a property named Description.
When I run the above code MRE.ToExpression<T>(rule) throws an InvalidOperationException with the message: No method 'Contains' on type 'System.String' is compatible with the supplied arguments.' exception.
Also found out that the following will throw the same exception when trying to compile the rule:
var rule = Rule.Create("Description", "Contains", "Do");
var compiledRule = new MRE().CompileRule<T>(rule);
var retVal = records.AsQueryable()
.Where(r => compiledRule(r))
.ToList();Metadata
Metadata
Assignees
Labels
No labels