コード例 #1
0
        public static CypherQueryRequest Create(string statement)
        {
            var match   = Regex.Match(statement, JsonRegex);
            var request = new CypherQueryRequest();
            var @params = new List <KeyValuePair <string, string> >();
            var count   = 0;

            while (match != null && match.Success)
            {
                var paramName = "param_" + count;
                statement = statement.Replace(match.Value, "{" + paramName + "}");
                @params.Add(new KeyValuePair <string, string>(paramName, match.Value));
                count++;
                match = match.NextMatch();
            }
            request.AddStatement(statement, @params.ToArray());
            return(request);
        }
コード例 #2
0
        public static CypherQueryRequest Create(string statement)
        {
            var match = Regex.Match(statement, JsonRegex);
            var request = new CypherQueryRequest();
            var @params = new List<KeyValuePair<string, string>>();
            var count = 0;

            while (match != null && match.Success)
            {
                var paramName = "param_" + count;
                statement = statement.Replace(match.Value, "{" + paramName + "}");
                @params.Add(new KeyValuePair<string, string>(paramName, match.Value));
                count++;
                match = match.NextMatch();
            }
            request.AddStatement(statement, @params.ToArray());
            return request;
        }