我似乎无法将其读入实体框架并使用 LINQ,因为我收到此错误:
无法检测到以下存储过程的返回类型。在“属性”窗口中设置每个存储过程的返回类型。
我尝试使用谷歌搜索,但解决方案似乎超出了我的想象。我有什么办法可以解决这个问题?绝望=[
我能想到的唯一方法是创建一个新表..但不幸的是我只能使用存储过程
ALTER PROCEDURE [dbo].[GetGame_FantasyHome]
-- Add the parameters for the stored procedure here
@GameDate varchar(8),
@TricodeHome varchar(3)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
CREATE TABLE #FantasyHome(
GameKey int,
PlayerName varchar(50),
Tricode varchar(3),
StatString varchar(50),
Position varchar(20),
FantasyScore int
)
DECLARE @gameKey int
SET @gameKey = (SELECT GameKey FROM Games WHERE GameDate=@GameDate
AND TricodeHome=@TricodeHome)
INSERT #FantasyHome
SELECT TOP 1 p.GameKey, p.PlayerName, p.Tricode, p.StatString, p.Position,
(p.Yards/25 + p.Touchdowns * 6 - p.Interceptions * 2) AS FantasyScore
FROM GamePassers AS p
WHERE p.GameKey=@gameKey AND p.Tricode=@TricodeHome
ORDER BY FantasyScore DESC, p.Yards DESC
SELECT *
FROM #FantasyHome
ORDER BY FantasyScore DESC
DROP TABLE #FantasyHome
END