This SPROC “returns” a table with two columns: Id, Score.
Is it possible to execute this SPROC and include the custom data-type as parameters from within Entity Framework?
ALTER PROCEDURE [presenta].[SearchLpi]
// The presenta.IdTableType is a table with just one column "Id"
@selectedLpis presenta.IdTableType READONLY
AS
BEGIN
SET NOCOUNT ON;
WITH Scores AS(
SELECT
ItemId, SUM(Score) AS Score
FROM [Presenta].[presenta].[LpivScores]
WHERE
ListPropertyItemId IN (
SELECT Id
FROM @selectedLpis
)
GROUP BY
ItemId
)
SELECT
i.Id,
s.Score
FROM
Scores s,
Items i
WHERE
s.ItemId = i.Id
END
If not, is there any other way to get the results of the SPROC and being able to join this result with another LINQ-query?
Here you are better of writing a EF linq query directly against the table. See http://msdn.microsoft.com/en-us/library/bb896341.aspx for an example.
If you must use stored procedures, then there is a way using a table as a return type. You need to create a temporary table with the fields that you return. See: http://blogs.msdn.com/bindeshv/archive/2008/11/20/using-stored-procedures-in-entity-framework.aspx