Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbulens/0d8b68bc3232192e1c1ebbaf2942c414 to your computer and use it in GitHub Desktop.
Save hbulens/0d8b68bc3232192e1c1ebbaf2942c414 to your computer and use it in GitHub Desktop.
var inner = PredicateBuilder.False<Product>();
inner = inner.Or(p => p.Description.Contains ("foo"));
inner = inner.Or(p => p.Description.Contains ("far"));
var outer = PredicateBuilder.True<Product>();
outer = outer.And(p => p.Price > 100);
outer = outer.And(p => p.Price < 1000);
outer = outer.And(inner);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment