2011-05-19 49 views
0

我有一個OData的查詢像這樣OData的延續,當項目目標框架是3.5

var Info= from p in context.Information      
where p.InformationSource.Equals("TopSecret")... 
order by p.Date 
select p; 

我經歷了數據這樣

foreach (var info in Info) {...} 

的問題是,如果項目的目標框架。 NET Framework 4.0我可以做到這一點

while (info.InformationSource.Continuation != null) 
{ 
    info.InformationSource.Load(context.Execute(info.InformationSource.Continuation)); 
} 

因爲product.InformationSource類型DataServiceCollectio n

但在3.5框架中它是類型集合,我不能這樣做。繼續。

問題是:當使用目標框架爲3.5時,如何從Feed中獲取所有數據?

回答

0

DataServiceCollection和Continuation(分頁)支持應該在最新的3.5SP1更新中可用。 http://www.microsoft.com/downloads/en/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=enhttp://www.microsoft.com/downloads/en/details.aspx?FamilyID=4B710B89-8576-46CF-A4BF-331A9306D555

在此之前更新,數據服務客戶端沒有分頁支持,應該從Feed中的所有數據。 希望這有助於。

+0

隨着3.5和4.0我得到的信息(300),但與4.0我可以使用.Continuation相同數量的對象獲取其餘。隨着3.5我不能這樣做,因爲類型(集合) – Vili 2011-05-20 05:14:01

相關問題