谁能给我一些方向,如何添加一个组件编程自定义tuplizer ?
将其添加到类中非常简单:
new Configuration().ClassMappings
.First()
.AddTuplizer(EntityMode.Map, "tuplizerClassName");
但是如何为组件完成同样的事情呢?
config.ClassMappings
.SelectMany(cm => cm.PropertyIterator)
.Where(prop => prop.IsComposite)
.Select(prop => prop.Value)
.Cast<NHibernate.Mapping.Component>()
.ForEach(c => c.TuplizerMap[NHibernate.EntityMode.Map] = "tuplizerClassName");