How to Use Like in Linq Dynamics?
I want to ach开发者_高级运维ieve something like this :-
var DB = new DALDataContext(); DB.Domains.Where("Name Like @p0",new [] {"field"});
use String.Contains()
property for this condition.
something like this source.Where(x => x.Name.Contains("someName"));
Also you can use SqlMethods.Like()
from System.Data.Linq.SqlClient namespace
example:
`var query = from s in Source
where SqlMethods.Like(s.Name, "%someName%")
select s;`
精彩评论