Once I have mapped my domain in NHibernate, how can I cancel the search for these mappings somewhere else in my code?
Example:
For some reason, the Pony object is mapped to a table named "AAZF1203". (Stupid database table names are obsolete!) I want to find out this table name from NH mappings using only typeof(Pony) , because I need to write the query elsewhere.
How to make the next test pass?
private const string LegacyPonyTableName = "AAZF1203"; [Test] public void MakeSureThatThePonyEntityIsMappedToCorrectTable() { string ponyTable = GetNHibernateTableMappingFor(typeof(Pony)); Assert.AreEqual(LegacyPonyTableName, ponyTable); }
In other words, what should GetNHibernateTableMappingFor(Type t) look like?
c # nhibernate nhibernate-mapping
snicker
source share