使用 AppFabric 时如何从缓存项目中删除标签

发布于 2024-11-30 15:00:04 字数 143 浏览 2 评论 0原文

我有多个标签缓存的对象。我可以请求它们,但我想从使用 GetObjectsByTag(tag,region) 返回的所有对象中删除一个特定标签。我不知道如何简单地删除标签或仅使用其他标签(我不只是查询的任何内容)将其放回原处。有人知道该怎么做吗?

I've got objects cached by multiple tags. I can request them but I want to remove one specific tag from all of the objects that were returned with GetObjectsByTag(tag, region). I can't figure out how to either simply remove the tag or Put the thing back in with only the other tags (anything I didn't just query with). Anyone know how to do this?

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

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

发布评论

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

评论(1

闻呓 2024-12-07 15:00:04

没有用于管理项目标签的特定 API,我怀疑即使您要使用扩展方法创建一个,本质上它也会归结为:

  1. 获取对象
  2. 获取 IEnumerable从对象中
  3. 删除不需要的标签
  4. 将对象与更新的标签集一起放置

如果您使用 Reflector 在 AppFabric 程序集中查找,可能有一种方法可以做到这一点,但如果您遇到问题,我怀疑您会这样做是由微软支持。

There's no specific API for managing the tags on an item, and I suspect that even if you were to create one using extension methods, essentially it would boil down to:

  1. Get the object
  2. Get the IEnumerable<DataCacheTag> from the object
  3. Remove the tags you don't want
  4. Put the object with the updated set of tags

There might be a way to do it if you poke around in the AppFabric assemblies with Reflector, but if you get a problem I doubt you'd be supported by Microsoft.

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