现在的位置: 首页 > 综合 > 正文

如何用同步的方式读取 WCF RIA Servies 中List

2013年04月03日 ⁄ 综合 ⁄ 共 706字 ⁄ 字号 评论关闭

public const string CustomerListPropertyName = "CustomerList";
        private IEnumerable<Customer> _customerList;
        public IEnumerable<Customer> CustomerList
        {
            get { return _customerList; }
            set
            {
                if (_customerList == value) return;
                var oldValue = _customerList;
                _customerList = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(CustomerListPropertyName);
            }
        }

 

void LoadAllData()
        {
            EntityQuery<Customer> query = _domainContext.GetCustomersQuery();
            LoadOperation<Customer> loadOp = _domainContext.Load(query);
            CustomerList = loadOp.Entities;
        }

 

还可以参考 DomainContext 和操作

【上篇】
【下篇】

抱歉!评论已关闭.