简体   繁体   English

如何缓存基于Sharepoint的托管客户端对象模型对象?

[英]How to Cache Sharepoint Managed Client Object Model based objects?

I need to Cache certain objects which are based on SharePoint Managed Client Object Model like ClientContext, GroupCollection, User , List etc. Initially I tried using Appfabric cache but it gives some issues like "cannot be serialized" . 我需要缓存某些基于SharePoint管理客户端对象模型的对象,如ClientContext,GroupCollection,User,List等。最初我尝试使用Appfabric缓存,但它提出了一些问题,如“无法序列化”。 Here my question is " Is it possible to serialize SharePoint Managed Client Object Model based Objects? " . 在这里,我的问题是“ 是否可以序列化基于SharePoint托管客户端对象模型的对象? ”。

Next I tried with .NET ObjectCache which actually caches the SP's Managed Client Objects but problem over here is I need a distributed / unified caching technique. 接下来我尝试使用.NET ObjectCache实际缓存SP的托管客户端对象,但问题是我需要一种分布式/统一缓存技术。 As per my knowledge we cant make ObjectCache distributed over multiple hosting servers. 据我所知,我们不能让ObjectCache分布在多个托管服务器上。 Can anyone suggest me a solution or show me light to proceed. 任何人都可以建议我一个解决方案或让我明白继续。 Thanks in advance. 提前致谢。

SharePoint Client Object Model will not support Object Cache wrt the Client objects. SharePoint客户端对象模型将不支持客户端对象的对象缓存。 That is the limitation in Client Object Model. 这是客户端对象模型的限制。

You cannot serialize the context or the result of a query. 您无法序列化上下文或查询结果。 Also a ListItem cannot be serialized. ListItem也无法序列化。 Nonetheless: At least when thinking about query-results the most important information you usually want to know is the content of the fields returned. 尽管如此:至少在考虑查询结果时,您通常想知道的最重要信息是返回字段的内容。 So, ListItem.FieldValues is a simple Dictionary<string,object> which can be easily serialized. 因此, ListItem.FieldValues是一个简单的Dictionary<string,object> ,可以很容易地序列化。

You could use this Dictionary in combination with the Listitem's ID to create your own caching mechanism. 您可以将此Dictionary与Listitem的ID结合使用来创建自己的缓存机制。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过托管客户端对象模型从SharePoint中检索图像 - Retrieving Images From SharePoint through the Managed Client Object Model SharePoint使用客户端对象模型(COM)枚举所有托管路径 - SharePoint enumerating all managed paths using the Client Object Model (COM) Sharepoint 2010 - 托管客户端对象模型 - 如何访问文档集(文件夹)中的文件 - Sharepoint 2010 - Managed Client Object Model - How to access files within a document set (folder) Sharepoint客户端对象模型区域设置 - Sharepoint Client Object Model locale 共享点客户端对象模型错误 - Error with sharepoint client object model 如何将我的代理凭据传递给 SharePoint 客户端上下文对象...? (SharePoint 客户端对象模型) - How do I pass my proxy credentials to a SharePoint Client Context object…? (SharePoint Client Object Model) 如何在Sharepoint 2013客户端对象模型中使用javascript getPeerUrl()函数? - How to use the javascript getPeerUrl() function in Sharepoint 2013 client object model? 如何使用客户端对象模型将SharePoint组添加为组所有者? - How to add a SharePoint group as Group Owner with Client Object Model? 如何在sharepoint客户端对象模型中获取批准状态字段值 - how to get approval status field value in sharepoint client object model 如何使用客户端对象模型检索呈现的Sharepoint WebPart数据 - How to retrieve rendered Sharepoint WebPart Data using Client Object Model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM