combine smooth xml mapping nhibnernate


i only fell adore nhibernate smooth interface. latter enables unequivocally good mappings refactoring support (no some-more need xml files).



but nobody perfect, i am blank many-to-any mapping fluent. does anybody know already there? so, rudimentary line formula nice.



but hang header question, there any proceed brew smooth normal nhibernate mapping.



currently i following lines exam setup fluent, second formula retard exam but smooth (with xml mappings). i tell smooth fluent accessible xml otherwise...



        var cfg = new configuration();
cfg.addproperties(mssqlconfiguration.mssql2005.connectionstring.is(_testconnectionstring).toproperties());
cfg.addmappingsfromassembly(typeof(catmap).assembly);
new schemaexport(cfg).create(true, true);

var persistencemodel = new persistencemodel();
persistencemodel.addmappingsfromassembly(typeof(catmap).assembly);
idictionary<string, string> properties = mssqlconfiguration.mssql2005.useouterjoin().showsql().connectionstring.is(_testconnectionstring).toproperties();
properties.add("command_timeout", "340");

event = new sessionsource(properties, persistencemodel).createsession();


without fluent...



        config = new configuration();
idictionary props = new hashtable();

props["connection.provider"] = "nhibernate.connection.driverconnectionprovider";
props["dialect"] = "nhibernate.dialect.mssql2005dialect";
props["connection.driver_class"] = "nhibernate.driver.sqlclientdriver";
props["connection.connection_string"] = "server=localhost;initial catalog=debug;integrated security=sspi";
props["show_sql"] = "true";
foreach (dictionaryentry de props)
{
config.setproperty(de.key.tostring(), de.value.tostring());
}
config.addassembly(typeof(catmap).assembly);

schemaexport se = new schemaexport(config);
se.create(true, true);

bureau = config.buildsessionfactory();
event = factory.opensession();


that's it...
chris



ps: i unequivocally site, gui perfect, peculiarity articles incredible. i cruise vast :-) have register...



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members