Created
September 28, 2011 17:43
-
-
Save cbcwebdev/1248621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to cache a query do something like: | |
var query = Session.CreateCriteria<T>() | |
.Add(Expression.Eq("Id", id)) | |
.SetCacheable(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nhibernate xmlns="urn:nhibernate-configuration-2.2"> | |
<session-factory name="default"> | |
<!-- other properties removed for brevity --> | |
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property> | |
<property name="cache.use_second_level_cache">true</property> | |
<property name="cache.use_query_cache">true</property> | |
</session-factory> | |
</nhibernate> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment