我想寫這一段代碼,將搜索數據庫中的表,我試圖尋找多列。我下面的東西似乎相當於WHERE column =「this」AND column2 =「this」,我想要做的就是這個WHERE column =「this」或者column2 =「this」我該怎麼做到這一點?ASP.NET的IQueryable哪裏或
query = query.Where(p => (p.ChckNumber.ToString()).Contains(globalSearch.ToString()));
query = query.Where(p => (p.BankAccount.ToString()).Contains(globalSearch.ToString()));
query = query.Where(p => (p.Description.ToString()).Contains(globalSearch.ToString()));
query = query.Where(p => (p.CheckAmount.ToString()).Contains(globalSearch.ToString()));
query = query.Where(p => (p.ClearedDate.ToString()).Contains(globalSearch.ToString()));
query = query.Where(p => (p.SentDate.ToString()).Contains(globalSearch.ToString()));
你見過這個帖子:http://stackoverflow.com/questions/25427485/how-to-用有或運營商在-LINQ-其中語句的 –
可能的複製【如何操作在LINQ使用或WHERE語句](http://stackoverflow.com/questions/25427485/how-to-use-or-operator -in-LINQ-其中語句) – Igor