是否可以以声明方式配置 spring.net 缓存而不是使用属性

发布于 2024-08-02 04:00:54 字数 185 浏览 7 评论 0原文

是否可以以声明方式配置 spring.net 缓存而不是使用属性?

我不想添加属性,例如:

[CacheResult("AspNetCache", "'Airport.Id=' + #id", TimeToLive = "0:1:0")]

我宁愿在配置文件中执行此操作

Is it possible to declaratively configure the spring.net cache rather using attributes?

I dont want to add the attribute such as :

[CacheResult("AspNetCache", "'Airport.Id=' + #id", TimeToLive = "0:1:0")]

I'd rather do this in configuration files

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

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

发布评论

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

评论(1

夜光 2024-08-09 04:00:54

It looks like spring.net doesn't support this yet. Quote from the documentation of the latest release (1.3rc1):
"The aspect currently relies on using attributes to specify the pointcut as well as the behavior, much like the transactional aspect. Future versions will allow for external configuration of the behavior so you can apply caching to a code base without needing to use attributes in the code."

And there is a related issue in their Jira.

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