是否可以以声明方式配置 spring.net 缓存而不是使用属性
是否可以以声明方式配置 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来spring.net还不支持这个。 引用自文档:
“该方面目前依赖于使用属性来指定切入点以及行为,就像事务方面一样。未来的版本将允许对行为进行外部配置,这样您就可以将缓存应用于代码库,而无需在代码。”
他们的 Jira 中有一个相关的问题。
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.