I have the following TVF for fulltext search:
FUNCTION [dbo].[Fishes_FullTextSearch]
(@searchtext nvarchar(4000), @limitcount int)
RETURNS TABLE
AS
RETURN
SELECT * FROM Fishes
INNER JOIN CONTAINSTABLE(Fishes, *, @searchtext, @limitcount)
AS KEY_TBL ON Fishes.Id = KEY_TBL.[KEY]
When I'm using this TVF, it doesn't return a collection of objects of type Fish (which I want!) - instead LINQ creates a new result type which includes all "Fish" fields and the fields Key and Rank.
In another question, it was suggested that I rewrite this TVF into a stored procedure for it to return Fish objects only. Can someone help me do this please? Also, it needs to be ordered by Rank.
Edit: I need objects of type "Fish" only, without Key or Rank. Otherwise LINQ will create a new return type which I can't use easily with my existing code.
Thank you!