Rewrite SQL Fulltext Function to return Table only
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开发者_StackOverflow中文版 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)?
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.
精彩评论