c# - Fluent NHibernate - Failure: NHibernate.MappingException : No persister for Tag -
i read 20 question prolem find no solution specific case here...
i use last version of nhibernate , fluent nhibernate installed via nuget
all class pubblic, have no error on build
this base class tests:
namespace gedi.integrationtest { public class basedbtest : idisposable { private static nhibernate.cfg.configuration configuration; private static isessionfactory sessionfactory; protected isession session; public basedbtest() { if (configuration == null) { configuration = new nhibernate.cfg.configuration(); configuration.configure(); // read config default style fluently.configure(configuration) .mappings(m => m.automappings.add(automap.assemblyof<tag>(new automapconfiguration()))); sessionfactory = configuration.buildsessionfactory(); } session = sessionfactory.opensession(); new schemaexport(configuration).execute(true, true, false, session.connection, console.out); } public void dispose() { session.dispose(); } }
}
this automapconfig:
namespace gedi.application.dataaccess.maps { public class automapconfiguration : defaultautomappingconfiguration { public override bool shouldmap(type type) { return type.namespace.endswith("entity"); //return type.name.equals("tag"); } }
and map
namespace gedi.application.dataaccess.maps { public class tagmap: classmap<tag> { public tagmap() {// omitted brevity} } }
this definizion of tag object:
namespace gedi.domain.object.entity { public class tag: ikeyedentity<int> {// omitted brevity} }
debuging test find shouldmap
never executed why?
Comments
Post a Comment