2016-09-27 2 views
0

두 개가 Table이고 다른 하나가 View 인 두 개의 Entities이 있으며 결과를 얻고 싶습니다. 이러한 엔티티 간에는 논리적 인 관계가 없습니다.
내 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 

하지만 컴파일러 던져 오류이 오류 보내

foreach (var es in eduStandard) 
    {  
    var vp = from ep in eduPost 
       where ep.StandardId == es.StandardId 
       select ep; 
    var result = from item in vp 
        where item.CAPACITY_CODE == ep.PostCode 
        select item; 
    } 

우리는 여전히를 사용할 수 있습니다

The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.

+1

'ep'와 'vp'에 대한 정의를 볼 수 있습니까? 'PostCode' 또는'CAPACITY_CODE'는 null 허용 타입입니까? –

+0

코드 작성 완료 –

+0

'PostCode'와'CAPACITY_CODE' 타입은 무엇입니까? 끈? 또는 다른 것? 조인이 작동하려면 같은 시간이거나 암시 적 변환이 필요합니다. –

답변

0

을이 시도 vp 테이블에 대한 정의.

+0

'eduPost' 코드를 기반으로 시퀀스 또는 컬렉션이며'PostCode' 속성을 갖지 않습니다. – juharr

+0

린크에 관계가 필요합니다 –

+0

답변을 수정하려고합니다 ... – tCoe

관련 문제