I am looking to do something like:
select * from MyValues
where CONTAINS(MyValues.Value, ' @p0 OR @p1 OR @p2 or @p3 ')
I issue the query through EF's SqlQuery() method like:
query = context.Database.SqlQuery<MyResult>(@"select * from MyValues
where CONTAINS(MyValues.Value, '@p0 OR @p1 OR @p2 OR @p3')",
new SqlParameter("@p0", "Cat"),
new SqlParameter("@p1", "Green"),
new SqlParameter("@p2", "Red"),
new SqlParameter("@p3", "Dog"));
The command goes through fine, no exceptions, but I do not receive any results. When I manually use the strings in place of the parameters, I get the expected results. I've tried various forms and combinations of quotation marks but to no avail.
Are SQL Parameters allowed within a CONTAINS expression?
Thanks!