我使用下面的代碼獲取頁面WCF服務的所有頁面:從WCF服務獲取的所有數據
var ent = new DataSource(new Uri("http://api.abc.com/Service.svc"));
ent.Credentials = new NetworkCredential("username", "pass");
DataServiceCollection<Rentals> rentals = new DataServiceCollection<Rentals>(ent.Rentals);
while (rentals.Continuation != null)
{
rentals.Load(ent.Execute<Rentals>(rentals.Continuation));
}
foreach (var r in rentals)
{
Response.Write(r.ListingID + "<br />");
}
,但我收到此錯誤:
An attempt to track an entity or complex type failed because the entity or complex type 'NorthwindService.ServiceReference1.Rentals' does not implement the INotifyPropertyChanged interface.
你可以調試到代碼,並看到**哪裏**(在哪一行)這個錯誤發生? –
我收到以下錯誤消息:DataServiceCollection rentals = new DataServiceCollection (ent.Rentals); –
DotnetSparrow