Quantcast
Channel: Fluent NHibernate caching with automapping - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Fluent NHibernate caching with automapping

$
0
0

I'm trying to understand how to configure Fluent NHibernate to enable 2nd-level caching for queries, entities, etc... And at the same time use automapping. There is very little information online on how to do that. Sure it can be done when mapping the classes one by one... But how about automapping?

Here is my configuration code so far:

AutoPersistenceModel model = AutoMap.AssemblyOf<Seminar>()
.Where(t => t.Namespace == "[MY NAMESPACE]")
.Conventions.Add(DefaultCascade.All());

Configuration config = Fluently.Configure()
.Database
(
    MsSqlConfiguration.MsSql2005
    .ConnectionString(@"[MY CONNECTION STRING]")
)
.Mappings(m => m.AutoMappings.Add(model))
.BuildConfiguration();

_sessionFactory = config.BuildSessionFactory();

Thanks!


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>