1

I'm trying to configure NHibernate's 2nd level cache. I want to configure by code and not use xml configuration I've followed most of the tutorial but I can't seem to translate this xml configuration in code:

<syscache>
    <cache region="LongTerm" expiration="180" priority="5" />
    <cache region="ShortTerm" expiration="60" priority="3" />
</syscache>

How can I configure the syscache region and expiration settings using code?

4

1 回答 1

1

Syscache 从应用程序配置文件中获取值。它不会通过代码公开任何配置。

您可以从https://github.com/diegose/NHibernate.Diegose克隆它(非权威,但最新)并自己实现代码 api。

于 2013-06-24T21:44:04.667 回答