Skip to content
AlbertoMonteiro edited this page Jun 16, 2011 · 12 revisions

Welcome to Dynamic Expression Builder


//I want only peoples that has car, and has 'o' on the name
var filter = new FilterExpression();
filter.Start(p => p.Name.Contains("o")).And(p => p.HasCar);
foreach(var item in persons.Where(filter.ResultExpression))
    Console.WriteLine(item.Name);
//Or
var filter2 = new FilterExpression();
filter2 = filter2.Start(p => p.Name.Contains("o"));
filter2 = filter2.And(p => p.HasCar);    
foreach(var item in persons.Where(filter2.ResultExpression))
    Console.WriteLine(item.Name);
Clone this wiki locally