Esempio n. 1
0
		private static Hashtable metaModelXPathExpressions = new Hashtable(); //manter guardado o comando sql de forma a ser gerado e compilado 1 única vez
		private static XPathExpression getMetaModelXPathExpression(string xpath)
		{
			XPathExpression metaModelXPathExpression = (XPathExpression)(metaModelXPathExpressions[xpath]);
			if (metaModelXPathExpression == null)
			{
				if (metaModelXPathNavigator == null)
				{
					metaModelXPathNavigator = MetaModel.CreateNavigator();
				}
				metaModelXPathExpression = metaModelXPathNavigator.Compile(xpath);
				metaModelXPathExpressions.Add(xpath, metaModelXPathExpression);
			}
			return metaModelXPathExpression;
		}