支持LINQ的C#关键字仍然是C#.考虑where
作为有条件的if
; 您以相同的方式执行逻辑操作.在这种情况下,您使用逻辑OR||
(from creditCard in AvailableCreditCards where creditCard.BillToName.ToLowerInvariant().Contains( txtFilter.Text.ToLowerInvariant()) || creditCard.CardNumber.().Contains(txtFilter.Text) orderby creditCard.BillToName select creditCard)