【发布时间】:2013-12-07 07:53:39
【问题描述】:
加入表格时出现错误,将结果作为列表返回。这是我的代码。请帮忙。谢谢
Public Function GetMerchantList() As List(Of Merchant)
Dim Db As New TTMSEntities
Dim Data = From p In Db.TT_MERCHANT Join r In Db.TT_BRANCH_SETTING On _
p.MERCHANT_BRANCH_INTERNAL_NUM Equals r.INTERNAL_NUM
Select New With {p.MERCHANT_ID, p.DESCRIPTION, r.INTERNAL_NUM, r.BRANCH_DESC}
If Data IsNot Nothing Then
Return ConvertMerchant(Data)
Else
Return Nothing
End If
End Function
错误
无法将“System.Data.Entity.Infrastructure.DbQuery1[VB$AnonymousType_04[System.String,System.String,System.Decimal,System.String]]”类型的对象转换为“System.Collections.Generic.List”类型1[TTMS.App.WebSites.Data.Merchant]
【问题讨论】:
-
你能提供
ConvertMerchant代码吗?