TSF.UmlToolingFramework.Wrappers.EA.Model.formatXPath C# (CSharp) Method

formatXPath() public method

formats an xpath accordign to the type of database. For Oracle and Firebird it should be ALL CAPS
public formatXPath ( string xpath ) : string
xpath string the xpath to format
return string
        public string formatXPath(string xpath)
        {
            switch (this.repositoryType) {

            case RepositoryType.ORACLE:
            case RepositoryType.FIREBIRD:
                return xpath.ToUpper();
            case RepositoryType.POSTGRES:
                return xpath.ToLower();
            default:
                return xpath;
            }
        }

Usage Example

        public static bool isItemUsedInASchema(UML.Classes.Kernel.Element element, TSF_EA.Model model)
        {
            var sqlGetCountSchemas = @"select count(*) as countresult from t_document d 
                                        inner join t_object o on o.ea_guid = d.ElementID
                                        where d.DocType = 'SC_MessageProfile' "
                                     + $"and d.StrContent like '%{element.uniqueID}%'";
            var resultXml = model.SQLQuery(sqlGetCountSchemas);
            var countNode = resultXml.SelectSingleNode(model.formatXPath("//countresult"));

            return(countNode.InnerText != "0");
        }
All Usage Examples Of TSF.UmlToolingFramework.Wrappers.EA.Model::formatXPath