Пример #1
0
        public static string ReplaceEntityReferencesInParameter(IDMLIdentifiers dmlIdentifiers, string inParam, bool enableFixLiteralsMisinterpretedAsIdentifiers)
        {
            var mc = NotAllowedTableNamesRegex.Matches(inParam);

            if (mc.Count > 0)
            {
                var m = mc[0];
                throw new DataBaseException("'" + m.Groups[2] + m.Groups[3] + "' found in 'Expand Inline' parameter is a reserved prefix");
            }

            var ret = inParam;

            if (!enableFixLiteralsMisinterpretedAsIdentifiers)
            {
                MatchEvaluator meReplaceAttributeName = match => ReplaceAttributeName(dmlIdentifiers, match);
                ret = AttributesRegex.Replace(ret, meReplaceAttributeName);
            }

            return(ret);
        }
Пример #2
0
        public static string ReplaceEntityReferencesInParameter(IDMLIdentifiers dmlIdentifiers, string inParam)
        {
            string          ret;
            MatchCollection mc;
            Match           m;

            mc = NotAllowedTableNamesRegex.Matches(inParam);
            if (mc.Count > 0)
            {
                m = mc[0];
                throw new DataBaseException("'" + m.Groups[2] + m.Groups[3] + "' found in 'Expand Inline' parameter is a reserved prefix");
            }

            ret = inParam;
            MatchEvaluator meReplaceAttributeName = match => ReplaceAttributeName(dmlIdentifiers, match);

            ret = AttributesRegex.Replace(ret, meReplaceAttributeName);

            return(ret);
        }