0

I'm trying to use full text search in Entity Framework 6. I've found a library https://www.nuget.org/packages/EfFts/ and it works but I need call CONTAINS function on two columns with OR not AND:

WHERE CONTAINS(title, 'test') OR CONTAINS(content, 'test')

but I really don't know how to force EF to create such a query.

reizals
  • 1,245
  • 1
  • 14
  • 21

1 Answers1

0

Did you try something like?

context.Database.SqlQuery<MyEntityType>("select * from table WHERE CONTAINS(title, {0}) OR CONTAINS(content, {1})", param1, param2);
Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90