Method TranslateIdentifiers
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
identifierConventionIdentifierCaseConventionThe convention to use for parsing the identifiers.
translateCypherParametersboolWhether 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
fieldConventionFieldCaseConventiontranslateCypherParametersbool
TranslateIdentifiers(IdentifierCaseConvention, FieldCaseConvention, bool)
Translates identifiers using the specified IdentifierCaseConvention and FieldCaseConvention.
public static void TranslateIdentifiers(IdentifierCaseConvention identifierConvention, FieldCaseConvention fieldConvention, bool translateCypherParameters = false)
Parameters
identifierConventionIdentifierCaseConventionThe convention to use for parsing the identifiers.
fieldConventionFieldCaseConventionThe convention to use for formatting the record fields.
translateCypherParametersboolWhether 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
translateCypherParametersboolWhen
true, also translates C# property names to database-style names when objects are used as Cypher query parameters. Defaults tofalse.
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
objectIdentifierParserIIdentifierParser<TParseResult>The parser used to parse object identifiers.
recordFieldFormatterIFieldFormatter<TParseResult>The formatter used to format record fields.
translateCypherParametersboolWhether to translate names of object properties to be used as Cypher parameters.
Type Parameters
TParseResultThe type of data returned by the parse.