이 람다 쿼리에 어떤 문제가 있습니까? 단지 특정 유형의 ProjectDocs을 포함에 나는 할 수 있도록하려면, ProjectDocs. 특정 유형의 파생 클래스 포함()?
ICollection<Project> projects = db.Projects
.Include(i => i.ProjectDoc.OfType<Cover>().Where(s => s.Status == "Active"))
.Include(i => i.ProjectDoc.OfType<Summary>().Where(s => s.Status == "Active"))
.Include(i => i.User)
.Include(i => i.ProjectTag.Select(t => t.Tag)).ToList();
파생 클래스, 세그먼트 및 요약을 표지에 내가 모델 ProjectDoc이 많은 종류가있을 수 있습니다. ProjectDoc을 포함시켜야하고 나중에 조건에서 식별자 열을 사용해야합니까? 유형 중 일부는 많은 수의 결과를, 일부는 많은 결과를 가질 수 있습니다.
내가 오류 ... "프로젝트"에
The Include path expression must refer to a navigation property defined
on the type. Use dotted paths for reference navigation properties and the
Select operator for collection navigation properties.
Parameter name: path
탐색 속성 ProjectDoc입니다. 파생 클래스에는 탐색 속성이 없습니다. 내가 그것을 시도했을 때 나는 여분의 톤이 있었다.
오류가 있습니까? –
@Hamlet이 주 질문에 오류를 추가했습니다. –