Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想实现这样的目标:-
var DB = new DALDataContext(); DB.Domains.Where("Name Like @p0",new [] {"field"});
在这种情况下使用String.Contains()属性。像这样的东西source.Where(x => x.Name.Contains("someName"));
String.Contains()
source.Where(x => x.Name.Contains("someName"));
您也可以使用SqlMethods.Like()System.Data.Linq.SqlClient 命名空间
SqlMethods.Like()
例子:
`var query = from s in Source where SqlMethods.Like(s.Name, "%someName%") select s;`