tags:

views:

86

answers:

4

There are 4 functions provided in SQL Server 2008 for full-text search: CONTAINS, CONTAINSTABLE, FREETEXT, FREETEXTTABLE

How to use it them with Linq ?

A: 

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.

marc_s
+1  A: 

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.

womp
A: 

.Where(x.Property.Contains(mysearchtext))

Russell Steen
I highly doubt this will work - check out the link that `womp` provided in his answer
marc_s
A: 

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"

Cory