如何使用linqkit之类的

时间:2016-01-14 09:53:25

标签: c# linq linqkit

data Name{"divan","dîvan","divân","dîvân" }

我希望在linq中使用select * from data where Name like % d_v_n %

然后预期结果为"divan","dîvan","divân","dîvân"

 //this linqkit code
 var searchPredicate = PredicateBuilder.False<ViewModelListManuscript>();    
 searchPredicate = searchPredicate.Or(m =>  m.TRTitle.ToLower().Contains("d_v_n"));    
 query = query.AsExpandable().Where(searchPredicate);

空结果

1 个答案:

答案 0 :(得分:0)

我想,您可以像这样使用SqlMethods.Like(matchExpression,pattern)

 var results = from dl in DataList
               where SqlMethods.Like(dl.Name,"%d_v_n%")
               select dl;