Table of Contents

Method TranslateIdentifiers

Namespace
Neo4j.Driver.Mapping
Assembly
Neo4j.Driver.dll

TranslateIdentifiers(IdentifierCaseConvention, bool)

Uses the supplied IdentifierCaseConvention to translate identifiers from the specified convention to camelCase database identifiers.

public static void TranslateIdentifiers(IdentifierCaseConvention identifierConvention, bool translateCypherParameters = false)

Parameters

identifierConvention IdentifierCaseConvention

The convention to use for parsing the identifiers.

translateCypherParameters bool

Whether to translate names of object properties to be used as Cypher parameters.

TranslateIdentifiers(FieldCaseConvention, bool)

Uses the supplied FieldCaseConvention to translate identifiers from standard C# identifiers to the specified database field naming convention.

public static void TranslateIdentifiers(FieldCaseConvention fieldConvention, bool translateCypherParameters = false)

Parameters

fieldConvention FieldCaseConvention
translateCypherParameters bool

TranslateIdentifiers(IdentifierCaseConvention, FieldCaseConvention, bool)

Translates identifiers using the specified IdentifierCaseConvention and FieldCaseConvention.

public static void TranslateIdentifiers(IdentifierCaseConvention identifierConvention, FieldCaseConvention fieldConvention, bool translateCypherParameters = false)

Parameters

identifierConvention IdentifierCaseConvention

The convention to use for parsing the identifiers.

fieldConvention FieldCaseConvention

The convention to use for formatting the record fields.

translateCypherParameters bool

Whether to translate names of object properties to be used as Cypher parameters.

TranslateIdentifiers(bool)

Translates identifiers using the default configuration. By default, it uses the CSharpIdentifier for parsing object identifiers and the CamelCase for formatting record fields.

public static void TranslateIdentifiers(bool translateCypherParameters = false)

Parameters

translateCypherParameters bool

When true, also translates C# property names to database-style names when objects are used as Cypher query parameters. Defaults to false.

Remarks

Call this method once at application startup if your database uses camelCase field names and your C# types use either camelCase or PascalCase property names (the most common scenario). After calling this method, a property named FirstName will automatically look up the record field firstName, and so on.

For other combinations of naming conventions, use one of the overloads that accept IdentifierCaseConvention and/or FieldCaseConvention to specify both ends of the translation.

When translateCypherParameters is true, the same translation is applied in the reverse direction when a C# object is passed as a query parameter — property names are translated to the database naming convention so parameter names stay consistent with field names.

Properties or parameters decorated with MappingSourceAttribute bypass translation entirely, because their path is treated as an explicit database field name.

TranslateIdentifiers<TParseResult>(IIdentifierParser<TParseResult>, IFieldFormatter<TParseResult>, bool)

Translates identifiers using a custom object identifier parser and record field formatter.

public static void TranslateIdentifiers<TParseResult>(IIdentifierParser<TParseResult> objectIdentifierParser, IFieldFormatter<TParseResult> recordFieldFormatter, bool translateCypherParameters = false)

Parameters

objectIdentifierParser IIdentifierParser<TParseResult>

The parser used to parse object identifiers.

recordFieldFormatter IFieldFormatter<TParseResult>

The formatter used to format record fields.

translateCypherParameters bool

Whether to translate names of object properties to be used as Cypher parameters.

Type Parameters

TParseResult

The type of data returned by the parse.