두 개가 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'.
'ep'와 'vp'에 대한 정의를 볼 수 있습니까? 'PostCode' 또는'CAPACITY_CODE'는 null 허용 타입입니까? –
코드 작성 완료 –
'PostCode'와'CAPACITY_CODE' 타입은 무엇입니까? 끈? 또는 다른 것? 조인이 작동하려면 같은 시간이거나 암시 적 변환이 필요합니다. –