Table of Contents

Class MappingSourceAttribute

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

Instructs the default mapper to use a different record field name (or dot-separated path) when mapping a value to the marked property or parameter. This attribute does not affect custom-defined mappers.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Parameter)]
public class MappingSourceAttribute : MappingBindingsAttribute, IMappingBindingMutator
Inheritance
MappingSourceAttribute
Implements
Inherited Members
Extension Methods

Remarks

Use this attribute when the record field name does not match the C# property or parameter name, or when global identifier translation via TranslateIdentifiers(bool) is active but you need to bypass it for a specific member.

A simple path is a single record key: [MappingSource("first_name")].

A dot-separated path lets you read a property from a nested entity or dictionary column: [MappingSource("person.name")] reads the name property from the record field person, where person is a node, relationship, or dictionary. All segments are matched case-sensitively.

When a EntityMappingSource other than Property is required (for example to read a node's labels), use the two-argument constructor.

Constructors

MappingSourceAttribute(string)

Instructs the default mapper to use the specified field name or dot-separated path when mapping to the marked property or parameter.

MappingSourceAttribute(string, EntityMappingSource)

Instructs the default mapper to use the specified record field and mapping source when mapping to the marked property or parameter.

Methods

Mutate(MappingBinding)

Called by the default mapper to allow this mutator to update the mapping configuration for a property or parameter.