开发者

Custom Tuplizer in Fluent Nhibernate

开发者 https://www.devze.com 2023-03-24 14:35 出处:网络
We\'re trying to pull offthis spectaular hack, and have got as far as foreach (var persistentClass in configuration.ClassMappings)

We're trying to pull off this spectaular hack, and have got as far as

foreach (var persistentClass in configuration.ClassMappings)
{
    persistentClass.AddTuplizer(EntityMode.Poco, typeof(Nul开发者_高级运维lableTuplizer).AssemblyQualifiedName);
}

but have no idea where this loop should go given we're using fluent NHibernate. Any suggestions?


Fluently.Configure()
    .Database(...)
    .Mappings(...)
    .ExposeConfiguration(config =>
    {
        foreach (var persistentClass in config.ClassMappings)
        {
            persistentClass.AddTuplizer(EntityMode.Poco, typeof(NullableTuplizer).AssemblyQualifiedName);
        }
    })
0

精彩评论

暂无评论...
验证码 换一张
取 消