WCF RIA 服务和会话外的持久/静态变量

发布于 2024-12-13 12:50:27 字数 164 浏览 7 评论 0原文

我想知道一旦客户端会话在 WCF RIA 服务中结束,是否有一种方法可以在业务层中保留变量。挑战是我们将加载相当数量的数据到缓存中,但希望缓存持续存在,并允许 silverlight 客户端连接到缓存,而无需重新创建它并重新加载所有数据。

有什么想法或解决方法吗?

谢谢你, 德里克

I am wondering if there is a way to persist variables in the business layer once the clients session has ended in WCF RIA Services. The challange is we are going to be loading a fair amount of data into caching but want the cache to persist, and allow the silverlight client to connect to the cache without recreating it and reloading all the data.

Any ideas or work arounds?

Thank you,
Derrick

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

画尸师 2024-12-20 12:50:27

我假设该服务托管在 IIS 上。您可以在 Web 服务中设置 ASPNET 兼容性,然后可以使用应用程序和会话变量。

在 Web.config 中设置:

请参阅:http://social.msdn.microsoft.com/forums/en-US/wcf/thread/71671241-eab0-4b9f-9343-6e4445ed41a5http://msdn.microsoft.com/en-us/library/ms733040.aspx

I presume the service is hosted on IIS. You can set the ASPNET compatibility on in a web service and then can use Application and Session variables.

Set this in Web.config: <serviceHostingEnvironment aspNetCompatibilityEnabled=”true” />

See: http://social.msdn.microsoft.com/forums/en-US/wcf/thread/71671241-eab0-4b9f-9343-6e4445ed41a5 and http://msdn.microsoft.com/en-us/library/ms733040.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文