private void ParseMappings(XPathNavigator navigator) { XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryMappingsExpression); while (xpni.MoveNext()) { MappingConfiguration mc = new MappingConfiguration(xpni.Current); if (!mc.IsEmpty()) { // Workaround add first an assembly&resource and then only the same assembly. // the <mapping> of whole assembly is ignored (included only sigles resources) // The "ignore" log, is enough ? // Perhaps we can add some intelligence to remove single resource reference when a whole assembly is referenced //if (!mappings.Contains(mc)) //{ // mappings.Add(mc); //} //else //{ // string logMessage = "Ignored mapping -> " + mc.ToString(); // if (log.IsDebugEnabled) // log.Debug(logMessage); // if (log.IsWarnEnabled) // log.Warn(logMessage); //} // The control to prevent mappings duplication was removed since the engine do the right thing // for this issue (simple is better) mappings.Add(mc); } } }
private void ParseMappings(XPathNavigator navigator) { XPathNodeIterator xpni = navigator.Select(CfgXmlHelper.SessionFactoryMappingsExpression); while (xpni.MoveNext()) { var mc = new MappingConfiguration(xpni.Current); if (!mc.IsEmpty()) { Mappings.Add(mc); } } }