我们试图取消this spectaular hack,并且已经达到了
foreach (var persistentClass in configuration.ClassMappings)
{
persistentClass.AddTuplizer(EntityMode.Poco, typeof(NullableTuplizer).AssemblyQualifiedName);
}
但不知道这个循环应该去哪里,因为我们正在使用流畅的NHibernate。有什么建议吗?
答案 0 :(得分:3)
Fluently.Configure()
.Database(...)
.Mappings(...)
.ExposeConfiguration(config =>
{
foreach (var persistentClass in config.ClassMappings)
{
persistentClass.AddTuplizer(EntityMode.Poco, typeof(NullableTuplizer).AssemblyQualifiedName);
}
})