/// <summary>
        /// Execute a saved procedure with parameters.
        /// </summary>
        /// <param name="graphId">The graph containing the saved procedure.</param>
        /// <param name="procedure">The procedure name.</param>
        /// <param name="args">A collection of positional arguments.</param>
        /// <param name="kwargs">A collection of keyword arguments.</param>
        /// <returns>A ValueTask, the actual result isn't known until `Exec` or `ExecAsync` is invoked.</returns>
        public ValueTask CallProcedureAsync(string graphId, string procedure, IEnumerable <string> args, Dictionary <string, List <string> > kwargs)
        {
            args = args.Select(a => RedisGraph.QuoteString(a));

            var queryBody = new StringBuilder();

            queryBody.Append($"CALL {procedure}({string.Join(",", args)})");

            if (kwargs.TryGetValue("y", out var kwargsList))
            {
                queryBody.Append(string.Join(",", kwargsList));
            }

            return(QueryAsync(graphId, queryBody.ToString()));
        }
 internal RedisGraphTransaction(ITransaction transaction, RedisGraph redisGraph, IDictionary <string, GraphCache> graphCaches)
 {
     _graphCaches = graphCaches;
     _redisGraph  = redisGraph;
     _transaction = transaction;
 }
        /// <summary>
        /// Execute a RedisGraph query with parameters.
        /// </summary>
        /// <param name="graphId">A graph to execute the query against.</param>
        /// <param name="query">The Cypher query.</param>
        /// <param name="parameters">The parameters for the query.</param>
        /// <returns>A ValueTask, the actual result isn't known until `Exec` or `ExecAsync` is invoked.</returns>
        public ValueTask QueryAsync(string graphId, string query, IDictionary <string, object> parameters)
        {
            var preparedQuery = RedisGraph.PrepareQuery(query, parameters);

            return(QueryAsync(graphId, preparedQuery));
        }
Esempio n. 4
0
 internal GraphCacheList(string graphId, string procedure, RedisGraph redisGraph)
 {
     _graphId    = graphId;
     _procedure  = procedure;
     _redisGraph = redisGraph;
 }