작동하지 않음을 선택합니다 (많은)에 포함 : Document
의 (a Customer
을 가지고)와 Customer
을 중 하나를 기반으로 고객에 대한 문서를 얻을 수RIA 서비스 : 나는 두 엔티티 유형이
내 쿼리는 (모음 Documents
있다) 고객의 이름 또는 번호
쿼리는 다음과 같습니다
public IQueryable<Document> GetCustomerDocuments(DateTime startDate, DateTime endDate, string filterText)
{
return this.ObjectContext.Customers
.Where(c => c.CustomerName.Contains(filterText) || c.CustomerNumber.Contains(filterText))
.SelectMany(c => c.Documents)
.Where(d => d.Date >= startDate && d.Date <= endDate);
}
쿼리 반환, 나는 그것이 둘다 Document
및 Customer
엔티티를 포함 할 .... 제가 포함 생각할 수있는 모든 것을 시도
Include("Documents.Customer")
, Include("Customer")
등.
나는 확실히 IncludeAttribute
을 메타 데이터로 설정했습니다.
생각하십니까? 이것은 가능한가?
감사합니다.
쿼리 결과를 ObjectQuery로 캐스팅하는 절대 생명의 은인. 답으로 표시하십시오. –