[英]Best fluent NHibernate configuration for Azure SQL V12?
I am looking to configure Fluent NHibernate with Azure SQL V12. 我想用Azure SQL V12配置Fluent NHibernate。 In the various posts online that I have seen, the configuration seems to be using MsSqlConfiguration.MsSql2008
. 在网上看到的各种帖子中,配置似乎正在使用MsSqlConfiguration.MsSql2008
。 If I understand it correctly, the newer MsSqlConfiguration.MsSql2012
should make use of some of the new features in SQL Server 2012+. 如果我正确理解,则较新的MsSqlConfiguration.MsSql2012
应该利用SQL Server 2012+中的一些新功能。 Could you please advise if this works correctly without issues? 您能告诉我这是否可以正常工作吗? Could you please point me at some documentation if available or provide full session factory configuration for comparison? 您能否指出一些可用的文档,或者提供完整的会话工厂配置以进行比较?
I have tested this basic configuration which seems to be ok with simple SQL statements: 我已经测试了这种基本配置,使用简单的SQL语句似乎可以:
var sessionfactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2012.ConnectionString(_databaseSettings.ConnectionString))
.Mappings(m => m.AutoMappings
.Add(AutoMap.AssemblyOf<TestEntity>()
.Where(a => a.Namespace.EndsWith("Entities"))
.UseOverridesFromAssemblyOf<TestEntityMappingOverride>()))
.BuildSessionFactory();
I am using FluentNHibernate version="2.0.3.0"
and NHibernate version="4.0.4.4000"
我正在使用FluentNHibernate version="2.0.3.0"
和NHibernate version="4.0.4.4000"
对于那些仍然感兴趣的人来说,这只是一个更新,接近问题中显示的配置的配置已在生产中正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.