Method 'Boolean Contains..' has no supported translation to SQL

后端 未结 5 1218
盖世英雄少女心
盖世英雄少女心 2020-12-21 21:09

i have this in my query:

var results = (from urls in _context.Urls
               join documents in _context.Documents on urls.UrlId equals documents.Documen         


        
5条回答
  •  既然无缘
    2020-12-21 21:39

    Another way of implementing this is to write a scalar UDF in the database that implements this functionality. Then drag that UDF onto the LINQ-to-SQL designer, which will give you access to your UDF via the data-context. Then you can use things like:

    where _context.MyContains(documents.Title, breakedQuery,
           KeywordParts.Title, part);
    

    and which will call the UDF after translation (i.e. WHERE dbo.MyContains(...))

提交回复
热议问题