I created a HibernateMapping in seperated Classes. The Mapping and classes are in one Assembly. The NUnit tests which I use to test this are in an other Assembly. I think I did it like in this post this
class testMapping : ClassMapping<test>{
//myMappings
}
Now I created a mapper and added it to my configuration:
var cfg=new Configuration();
cfg.Configure();
var mapper = new ModelMapper();
mapper.AddMappings(Assembly.GetExecutingAssembly().GetExportedTypes());
cfg.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntries());
var session = cfg.BuildSessionFactory();
but my Mapping is not found.
Do I replace the mapper.AddMappings()
with:
mapper.AddMappings(New List<SystemType> {typeof(testMapping)});
it will work.
Do I use the GetExecutingAssembly wrong?
I dont want to add ALL my Mappings seperately.