1.使用in查询
IN
C#
var
result = from s in context.Customers where (new string[]
{ "UK", "Lisboa" }).Contains(s.City) select s;
NOT IN
C#
var result = from s in context.Customers where !(new string[] {"UK", "Lisboa"}).Contains(s.City) select s;
2.使用SqlMethods.Like查询
C#
(1)、var result = from s in context.Customers where SqlMethods.Like(s.City, string.Format("%{0}%", "Lisboa")) select s;
(2)、from o in Dao.Table<TBORGANIZATION>() where o.ORGANIZATIONNO.StartsWith(org.ORGANIZATIONNO) select o.ID //o.ORGANIZATIONNO.StartsWith(org.ORGANIZATIONNO)相当于 sql 的 o.ORGANIZATIONNO like org.ORGANIZATIONNO+"%"