Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. List<long> lstPA = new List<long>() { 2, 3 }; // the numbers can be added or removed
  2.  
  3. var exp1 = Predicate.FalseExpression<posts>();
  4. exp1 = exp1.Or(x => x.post_author == 2);
  5. exp1 = exp1.Or(x => x.post_author == 3);
  6.  
  7. var exp1 = Predicate.FalseExpression<posts>();
  8. foreach (long id in lstPA)
  9. {
  10. exp1 = exp1.Or(x => x.post_author == id);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement