I'm playing with NH 3.2.0 mapping by code. Since I've a scenario in which I can map everithing b开发者_如何学Cy convention I would like to add raw entities to the mapper, and then customize them by a custom ModelInspector
plus the event generated by the ModelMapper
. Unfortunately the ModelMapper apparently does not allow me to add entity dirctly, instead he want object implementing IConformistHoldersProvider
, so I eventually end with pass empty classes implementing ClassMapping for each entity I want to map. Is there some smartest way to achieve the same ?
Thanks.
Well I found myself, problem was that I was using mapper.CompileMappingForAllExplicitlyAddedEntities();
the problem simply does not sussists if I use
mapper.CompileMappingFor()
and I pass the required entities...
精彩评论