2010-07-23 40 views
0

IM使用Silverlight和RIA服務我在河口以下LINQ函數,返回稱爲DependantPerson對象:如何在LINQ查詢包括許多級別的對象

public IQueryable<DependantPerson> GetDependantPersons(int PerID) 
    { 
     return this.ObjectContext.DependantPerson 
      .Include("Person1") 
      .Where(dp => dp.Person_FK == PerID) 
      .OrderBy(dp => dp.ID); 
    } 

現在DependantPerson涉及稱爲PERSON1至極另一個對象我包含在這個查詢中,而Person1又與第三個對象SimpleListValue相關,我怎樣才能告訴LINQ我也在Person1中包含了SimpleListValue,所以我可以稍後在XAML端使用它,如下所示:

... sdk:Label Content =「{Binding Person1.MotherName}」

... SDK:標籤內容= 「{結合Person1.SimpleListValue.Label}」

第一個例子Person1.MotherName工作得很好,但第二Person1.SimpleListValue.Label不能正常使用我認爲這個問題是我的LINQ查詢

任何幫助表示讚賞感謝您的時間和我

回答