tags:

views:

28

answers:

2

Pseudo code:

SELECT * FROM 'table' WHERE ('date' < today) OR ('visible' = false)

How do you do OR in Linq?

+4  A: 

You just use the language specific OR condition. In C#:

var results = from row in table
              where row.date < today || row.visible == false
              select row;

If you prefer the method syntax:

var results = table.Where(row => row.date < today || row.visible == false);
Reed Copsey
+2  A: 

Reed nailed the C# one, here is the VB.Net equivalent

Dim results = _
  From row In table _
  Where row.Date < today OrElse row.Visible = False 
JaredPar
Found it. My fault for rushing!
JohnnyBizzle