Silverlight WCF RIA Services 示例

首先 建立SL4项目的时候记得把那个RIA的选项钩上

其次,建立自定义DomainService 继承DomainService即可

调用示例 :

private DomainContext DomainContext = new DomainContext();

返回IEnumerable<T> 的

EntityQuery<T> Query = DomainContext.GetQuery(start,count);
DomainContext.Load(Query, this.OnLoaded, null);

private void OnPicturesLoaded(LoadOperation<T> loadOperation)
     {

    }

返回Int的

InvokeOperation<int> getCount = DomainContext.GetCount();
getCount.Completed += new EventHandler(getCount_Completed);

private void getCount_Completed(object sender, EventArgs e)
        {
        }

原文地址:https://www.cnblogs.com/xh831213/p/1791801.html