사용 NCache NHibernate 애플리케이션을 사용하는 것은 다단계 프로세스입니다.
설치 및 구성 NCache 다음 단계로 요약할 수 있습니다.
자세한 내용은 7분 시청 NCache 비디오 시작하기 위한 XNUMX단계.
사용하려면 NCache NHibernate의 레벨 2 공급자로서 app.config 또는 web.config 파일에 다음 줄을 추가합니다.
<hibernate - configuration>
...
<session - factory>
...
<property name = "cache.provider_class">
Alachisoft.NCache.Integrations.NHibernate.Cache.NCacheProvider,
Alachisoft.NCache.Integrations.NHibernate.Cache
</property>
</session - factory>
</hibernate - configuration>
이제 구성했으므로 NCache NHibernate의 레벨 2 공급자가 되려면 몇 가지를 제공해야 합니다. NCache 특정 속성. 이러한 속성은 도움이 됩니다. NCache 귀하의 응용 프로그램으로 작업하십시오.
<configSections>
...
<section name = "ncache"
type = "Alachisoft.NCache.Integrations.NHibernate.Cache.NCacheSection,
Alachisoft.NCache.Integrations.NHibernate.Cache"/>
</configSections>
위의 줄은 "ncache" 구성 파일의 섹션. 이제 지정하십시오. NCache 이 "의 속성ncache" 부분.
<ncache>
<!--default regionis used if no other regions are specified.-->
<region name = " default ">
<add key = " cacheName " value = " myCache " />
<add key = " enableCacheException " value = " false " />
</region>
<!--see docs for custom regions & db - synchronization properties.-->
</ncache>
더있다 NCache 캐시를 데이터베이스와 동기화하려는 경우 속성. 자세한 내용은 제품 설명서를 참조하십시오.