score:4

var query = // some core query

if(s == null) { query = query.Where(x => x.Foo == null); }
else { query = query.Where(x => x.Foo == s); }

Related Query

More Query from same tag