CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

SessionFactoryName

228 Views
Copy Code Show/Hide Line Numbers
Configuration config = Fluently.Configure()
    .Database(MsSqlConfiguration.MsSql2008.ConnectionString(
                  c => c.FromConnectionStringWithKey("ConnectionString"))
                  .Cache(c =>
                         c.UseQueryCache()
                             .QueryCacheFactory<StandardQueryCacheFactory>()
                             .ProviderClass<HashtableCacheProvider>()
                             .UseMinimalPuts()
                  )
                  .UseReflectionOptimizer()
                  .MaxFetchDepth(4)
                  .AdoNetBatchSize(1000)
    )
    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<BillingRecordMap>()
                       .Conventions.AddFromAssemblyOf<EnumConvention>())
    .BuildConfiguration();
 
config.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true");
config.SetProperty(NHibernate.Cfg.Environment.SessionFactoryName, "YourSessionFactoryName");
 
ISessionFactory sessionFactory = config.BuildSessionFactory();
by Mikael Henriksson
  October 25, 2009 @ 2:45am
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate