开发者

Silverlight ObservableCollection cannot get data from EntityQuery

开发者 https://www.devze.com 2023-04-08 23:05 出处:网络
I am trying to g开发者_运维问答et data that are returned from an EntityQuery public EntityQuery<Product> GetProductsQuery()

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

0

精彩评论

暂无评论...
验证码 换一张
取 消