问题:Silverlight端通过RIA更新数据并提交后,通过Load方法刷新数据:
private void LoadJobs(int locationID, DateTime datetime)
{
this.LocationID = locationID;
this.Day = datetime.Date;
context.Load(context.GetJobsByDateQuery(Day),JobsLoaded, null);
}
原因: 然而客户端的数据并为刷新。通过调试,服务端已经将数据修改提交的数据库,且服务端的GetJobsByDate方法确实返回了最新的数据。然而,客户端context.Jobs中的数据仍为修改前的数据。缓存问题
解决:这篇blog
提到了一个重要参数LoadBehavior, 将上面方法修改为:
private void LoadJobs(int locationID, DateTime datetime)
{
this.LocationID = locationID;
this.Day = datetime.Date;
context.Load(context.GetJobsByDateQuery(Day),LoadBehavior.RefreshCurrent, JobsLoaded, null);
}
RIA在客户端内存中存有EntitySet的缓存,使用LoadBehavior.RefreshCurrent
,刷新缓存
分享到:
相关推荐
WCF RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. RIA Services provides a pattern to write application logic that runs ...
Silverlight 4 in Action - Silverlight 4, MVVM, and WCF RIA Services
微软官方提供的wcf RIAServices帮助文档
在Windows 2003 sp2 + IIS6.0 环境下部署Silverlight + WCF Ria Services应用程序步骤: 1:安装IIS 6.0 (默认有可以跳过) 2:安装Framework4.0 3:安装Silverlight_4_Toolkit_April_2010.msi 4:建创网站的虚拟目录 哈哈...
1、采用了WCF RIA Services来和服务器端传输数据,具体来说就是Silverlight项目 类型中的WCF RIA Services 类库项目,因为这个更快捷。 2、采用了MVVM设计模式来实现UI元素也UI界面逻辑分离,这个的好处地球人都知道...
A reference project that demonstrate how to build a task management application with WCF RiaServices, Silverlight 4.0, MEF, MVVM, and Telerik Controls. Requirement: VS2010, Silverlight 4 RTM, ...
一个简单的 Silverlight 4 应用程序(MEF+ MVVM+ WCF RIA Services)配套源代码及安装文件 本文是Weidong Shen先生在CodeProject上的文章源代码
silverlight与WCF RIA Service数据库操作相关,共有十多个word文档,介绍WCF RIA Service数据库操作的方方面面,不可不看。
WCF RIA Service Silverlight 商业应用 只是个例子
迁移WcfToWebApi .NET Core控制台应用程序,可自动生成ASP.NET Web API服务和关联的客户端代码文件,以替换现有的WCF服务终结点。 C#的库用于解析/生成文件。安装克隆回购建立解决方案使用指定的参数从命令行运行...
(英文版)WCF 4.0 Multi-tier Services Development with LINQ to Entities Packt Publishing 出版2010, PDF格式
6)WCF RIA Services V1.0 for Visual Studio 2010(Silverlight访问数据库Ria Wcf服务) 7)安装Northwind数据库。这个数据库可以从网上搜到。 另外,如需要发布后请到 聚拓互联订购支持wcf ria服务的asp.net4.0虚拟...
Silverlight WCF RIA服务(六)创建RIA Services 类库 源代码
WCF-消息服务 C# .NET 4.5.1 WCF 消息服务和客户端 介绍该项目是我仅使用代码(不使用配置或 wsdl 文件)演示 WCF 服务器和客户端应用程序 控制台服务器正是这样:一个运行简单 WCF 消息服务的 C# 控制台应用程序。 ...
Silverlight WCF RIA服务 (三)创建一个RIA Services Solution 例子的源代码。
WCF简单实例--WCF简单实例--WCF简单实例--WCF简单实例--WCF简单实例--WCF简单实例--
Apress Pro WCF 4 Practical Microsoft SOA Implementation, 2nd Part I: Introducing Windows Communication Foundation ■Chapter 1: WCF and SOA Basics ■Chapter 2: What’s New in WCF 4 ■Chapter 3: ...
Title: WCF Multi-Layer Services Development with Entity Framework, 4th Edition Author: Mike Liu Length: 388 pages Edition: 4 Language: English Publisher: Packt Publishing Publication Date: 2014-10-27 ...
使用WCF行为处理跨源资源共享协议的示例项目( ) 请参阅文档
this guide provides unique insight, rather than documentation, to help you learn the topics and skills you need for building maintainable, extensible, and reusable WCF-based applications. Authors ...