Silverlight ObservableCollection cannot get data from EntityQuery
I am trying to g开发者_运维问答et data that are returned from an EntityQuery
public EntityQuery<Product> GetProductsQuery()
and I am using an ObservableCollection to store them
var query = ctx.GetProductsQuery();
ctx.Load(query, op =>
{
var data = op.Entities;
ProductList = new ObservableCollection<Product>(op.Entities);
return;
}, null);
but after this code, the ProductList is still empty
Here are a couple of links hope they shed more light on your issue. They describe how to load data from RIA serives into ObservableCollections
Loading WCF RIA Services Query results to an ObservableCollection
Loading Data from RIA Services
精彩评论