我正在尝试针对两个上下文运行查询,并且每次都会收到此错误:
无法创建“CC_Metrics_Apps.RefQutReturns”类型的常量值。此上下文仅支持原始类型(“例如 Int32、String 和 Guid”)。
我试图这样查询:
Public Function IDQ() As List(Of RefQutReturns)
Dim val As List(Of RefQutReturns) = (From x In GlobalVar.db.RET.RefQutReturns
Select x).ToList
Return val
End Function
Public Function QueTypeDD() As IEnumerable(Of SelectListItem)
Dim val As New List(Of SelectListItem)
Dim valQ = From v In GlobalVar.db.PS.TaskQueueTypes
Join x In IDQ() On v.QutID Equals x.QutID.ToString
Select v
val.Add(New SelectListItem With {.Text = "Select Item", .Value = 0})
For Each v In valQ
val.Add(New SelectListItem() With {.Text = v.QutDesc, .Value = v.QutID})
Next
Return val
End Function