开发者

How to use Contains() in my join

开发者 https://www.devze.com 2022-12-25 05:56 出处:网络
I am trying to get my linq query to replicate my t-sql but I am lost. SELECT * FROM BaiDetail INNER JOIN

I am trying to get my linq query to replicate my t-sql but I am lost.

SELECT *
FROM BaiDetail INNER JOIN
     BaiDetailMap ON BaiDetail.DetailText 
     LIKE 开发者_如何学编程'%' + BaiDetailMap.BaiDetailMapSearchText +'%'

This is what I have so far... but no go

from det in Source
from map in Map
where det.DetailText.Contains(map.SearchText)
select new {det, map}

Error Message:

Only arguments that can be evaluated on the client are supported for the String.Contains method.


from det in Source
from map in Map
where SqlMethods.Like(map.DetailText, "%" + map.SearchText + "%"))
select new {det, map}
0

精彩评论

暂无评论...
验证码 换一张
取 消