对于方法 String.Contains,只支持可在客户端上求值的参数。 --这是怎么回事?
代码如下:
var select = from ar in adc.Articles
from au in adc.Authors
where ar.ShowTime > timeset && ar.AuthorType == typeid && ar.Author.Contains(au.Name) == true && ar.Title.Contains(au.Name) == true
orderby ar.ShowTime descending
select new
{
arid = ar.Id,
ar.Code,
ar.Title,
ar.ShowTime,
auid = au.Id,
au.Name,
au.PinYin,
au.GoUrl
};
foreach (var item in select)
{
AuthorArticle aa = new AuthorArticle();
aa.ArticleId = item.arid;
aa.ArticleCode = item.Code;
aa.ArticleTitle = item.Title;
aa.ArticleShowTime = item.ShowTime;
aa.AuthorId = item.auid;
aa.AuthorName = item.Name;
aa.AuthorNamePY = item.PinYin;
aa.AuthorGoUrl = item.GoUrl;
aalist.Add(aa);
}
((
(CASE
WHEN (CONVERT(Int,DATALENGTH([t1].[Aut_Name]) / 2)) = 0 THEN CONVERT(BigInt,0)
ELSE CONVERT(BigInt,(CONVERT(Int,CHARINDEX([t1].[Aut_Name], [t0].[Art_Author_Name]))) - 1)
END)) > -1)
like '%查询字符%'