Table of Contents

Constructor Query

Namespace
Neo4j.Driver
Assembly
Neo4j.Driver.dll

Query(string)

Create a query with no query parameters.

public Query(string text)

Parameters

text string

The query's text

Query(string, object)

Create a query with parameters as an object.

public Query(string text, object parameters)

Parameters

text string

The query's text.

parameters object

The query parameters. The driver converts this object to a Cypher parameter map as follows:

  • Anonymous types and POCOs: each public property becomes a Cypher parameter, with the property name used as the key. Nested objects become Cypher maps; collections and arrays become Cypher lists.
  • Dictionary types (System.Collections.Generic.IDictionary<TKey, TValue> with string keys, System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>, or System.Collections.Generic.IEnumerable<T> of System.Collections.Generic.KeyValuePair<TKey, TValue>): treated as the parameter map.

Renaming parameters: decorate a property with CypherParameterMappingAttribute to override the key used in the Cypher parameter map. For full control, implement IMappingBindingMutator on a custom attribute.

Global name translation: if RecordObjectMapping.TranslateIdentifiers has been called with translateCypherParameters: true, the configured IConventionTranslator is applied to top-level property names that do not carry an explicit CypherParameterMappingAttribute.

Query(string, IDictionary<string, object>)

Create a query

public Query(string text, IDictionary<string, object> parameters)

Parameters

text string

The query's text

parameters IDictionary<string, object>

The query's parameters, whose values should not be changed while the query is used in a session/transaction.