0
我的代码是:错误无法投类型System.Collections.Generic.List的对象键入System.Linq.IQueryable
'GET:的OData/Event_Game_Schedule
<EnableQuery>
Function GetEvent_Game_Schedule() As IQueryable(Of Event_Game_Schedule)
Dim schedule As New List(Of Event_Game_Schedule)
schedule = db.Event_Game_Schedule.ToList()
For Each x As Event_Game_Schedule In schedule
x.hometeamid = (From t In db.Teams Where t.id = x.hometeamid Select t.name).FirstOrDefault
x.visitorteamid = (From t In db.Teams Where t.id = x.visitorteamid Select t.name).FirstOrDefault
Next
Return schedule.AsQueryable.ToList()
End Function
我在做什么错..这是一个控制器,我想返回团队的名称而不是API中的teamid。
感谢
这不看起来像VBA - 因为当VBA有像List(Of ...)'和'Return'这样的东西吗?我是否需要挖掘手册并修改最新版本中的更改? – YowE3K