我有一个从数据实体查询数据的 WCF。如果语法没有放入“AsEnumerable”,我有点困惑为什么它会抱怨“方法加入不支持”,并且它有一种不使用 AsEnumerable 的方法。因为我读过一些文章提到它会在执行“where”条件之前放置所有数据。
Dim ent As DataEnties.DPPromoterEntities
Dim que = Nothing
Dim sRet As String = ""
Try
ent = New DataEnties.DPPromoterEntities(New Uri(AppSettings.Item("Data")))
que = From CHS In ent.RC_CampaignHubSpokeTbl.AsEnumerable '<--This line
Join Cam In ent.RC_CampaignTbl.AsEnumerable On Cam.intCampaign Equals CHS.intCampaign'<--This line
Where Cam.tintStatus.Equals(1)
Select New With {CHS.intCampaign,
CHS.intCouponRefHub,
CHS.intCouponRefSpoke,
CHS.intHubRef,
CHS.intSpokeRef}
sRet = New JavaScriptSerializer().Serialize(que)
Catch ex As Exception
clsLog4Net.WriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name.ToString, ex.Message, True)
End Try