There are 4 functions provided in SQL Server 2008 for full-text search: CONTAINS, CONTAINSTABLE, FREETEXT, FREETEXTTABLE
How to use it them with Linq ?
You cannot translate a linq query into full-text search functions, there is no direct support for this.
However, there are some workarounds - see http://sqlblogcasts.com/blogs/simons/archive/2008/12/18/LINQ-to-SQL---Enabling-Fulltext-searching.aspx for an indirect method of using full-text search.
See stackoverflow post "Is it possible to use Full Text Search (FTS) with LINQ?" which provides a link to the blog post "Linq to SQL - Enabling Fulltext Search"
As far as I know, there's no built-in support for those functions in LINQ - you'll need to formulate your T-SQL query and then use the Linq's DataContext.ExecuteQuery()
call to send that T-SQL directly to SQL Server.
精彩评论