You must enclose it in brackets:
roles.Contains(u.RoleID.Value) && (u.isValid ?? false)
a bit confused with (u.isValid ?? false), does this mean that if u.isValid == null then make it false and look for users for whom u.isValid is false, this is not what I want .
, , nulls false , isValid null false. , ?? -operator Nullable<bool> bool, &&. , , :
roles.Contains(u.RoleID.Value) && u.isValid.HasValue && u.isValid.Value
== -operator bool? :
roles.Contains(u.RoleID.Value) && u.isValid == true