borisdj
borisdj

Reputation: 2509

Entity Framework 5, Code First, Full Text Search but IQueryable via CreateQuery?

I am using .NET 4.5 and EF 5 with Code First approach and now I need to implement Full Text Search. I have already read a lot about it and so far my conclusions are:

But this returns IEnumerable and I want IQueryable so that I can do more filtering before fetching the data from db server. I know I can send those parameters to Db function but I don't want that.

So the questions are:

Upvotes: 3

Views: 2572

Answers (1)

NSGaga
NSGaga

Reputation: 14302

Try it like this

ObjectQuery<Movie> query = 
    objectContext.CreateQuery<Movie>(@"SELECT VALUE movie FROM Movies");  

As for why see these links

Differences from Transact-SQL Unlike Transact-SQL, Entity SQL does not support use of the * argument in the SELECT clause. Instead

Entity SQL Reference - SELECT
"SELECT VALUE" - value keyword in LINQ/Entity Framework query

Upvotes: 2

Related Questions