我尝试保存“linq-object”,然后添加 where 子句。这将构建但在第一行崩溃,并出现以下错误。我可以看到匿名部分有两种类型,我尝试将其仅转换为其中一种。但是我该如何正确地做到这一点?
“无法将‘System.Data.Linq.DataQuery
1[VB$AnonymousType_0
2 [SubscriberContact,Subscriber]]’类型的对象转换为‘System.Linq.IQueryable`1[SubscriberContact]
Dim subscriberContacts As IQueryable(Of SubscriberContact) =
(From sc In GetTable(Of SubscriberContact)(), s In GetTable(Of Subscriber)()
Where sc.Subscriber.SubscriberId = s.SubscriberId)
If Not searchCriteria.CustomerNo = Nothing Then
subscriberContacts = From sc In subscriberContacts
Where sc.Subscriber.CustomerNumber.Value = searchCriteria.CustomerNo()
End If