我有两个Entities
,其中一个是Table
,另一个是View
,我想从中得到结果。这些实体之间没有逻辑关系。
我的LINQ查询:从第二join
如何获取表和视图之间的数据与linq没有关系?
var eduStandard = App.Api.EduStandardService.Instance().Data();
var eduPost = App.Api.EduStandardPostService.Instance().Data();
var result=from es in eduStandard
join ep in eduPost on es.StandardID equals ep.StandardID
join vp in Data() on ep.PostCode equals vp.CAPACITY_CODE
但是编译器抛出一个异常,并发出这样的错误:
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.
我们可以看到'ep'和'vp'的定义。 PostCode或CAPACITY_CODE是可为空的类型吗? –
我完成了我的代码 –
'PostCode'和'CAPACITY_CODE'是什么类型?串?或者是其他东西?为了加入工作,他们需要是同一时间或有一个隐式转换。 –