public async Task <IResultCursor> RunAsync(Query query)
        {
            if (query?.Parameters?.Count > 0)
            {
                var parameters    = query.Parameters;
                var modifications = new Dictionary <string, object>();

                foreach (var entry in parameters.Keys)
                {
                    if (parameters[entry] is JObject valueJObject)
                    {
                        //we need to convert this to dictionary so it can be understood by the driver.
                        //otherwise, the driver would assume the JObject is a List,
                        //because JObject inherits from JContainer which in turn inherits from IList<JToken>.
                        modifications[entry] = valueJObject.ToObject <Dictionary <string, object> >();
                    }
                }

                foreach (var entry in modifications)
                {
                    parameters[entry.Key] = entry.Value;
                }
            }

            return(SessionWrapper.GetResultCursor(await WrappedItem.RunAsync(query)));
        }
Ejemplo n.º 2
0
 public async Task <IResultCursor> RunAsync(string query, IDictionary <string, object> parameters,
                                            Action <TransactionConfigBuilder> action)
 {
     return(GetResultCursor(await WrappedItem.RunAsync(query, parameters, action)));
 }
Ejemplo n.º 3
0
 public async Task <IResultCursor> RunAsync(string query, Action <TransactionConfigBuilder> action)
 {
     return(GetResultCursor(await WrappedItem.RunAsync(query, action)));
 }
Ejemplo n.º 4
0
 public async Task <IResultCursor> RunAsync(Query query)
 {
     return(GetResultCursor(await WrappedItem.RunAsync(query)));
 }
Ejemplo n.º 5
0
 public async Task <IResultCursor> RunAsync(string query, IDictionary <string, object> parameters)
 {
     return(GetResultCursor(await WrappedItem.RunAsync(query, parameters)));
 }
 public async Task <IResultCursor> RunAsync(string query)
 {
     return(SessionWrapper.GetResultCursor(await WrappedItem.RunAsync(query)));
 }