views:

15

answers:

1

I have a MS SQL Fulltext Function like this:

(...)
RETURNS TABLE AS RETURN
SELECT * FROM fishes
INNER JOIN CONTAINSTABLE(fishes, *, @keywords, @limit)
AS KEY_TBL ON fishes.id = KEY_TBL.[KEY]

When I use this function in LINQ, it generates a special return type which includes all fields of my "fishes" table, plus Key and Rank.

How could I rewrite above query, or change something in LINQ, to omit Key and Rank and just return my "fishes" results (and to have the fulltext search result objects be of type Fish, which is what I really care about, so I don't have to cast)?

A: 

Rewrite it as a stored procedure rather than a tvf, attach the sp as a method of the fishes class in the o/r designer. It should then return collections of fish.

Ben Robinson
Can you elaborate a bit more please and clarify how I attach the SP as a method of the fishes class?
Alex
You simply drag the SP from server explorer onto the class in the design window. I think i was mistaken in that it is a method on the DataContext class rather than your fishes class, but if you drag the SP ontothe classit will return collections of fish.
Ben Robinson