Interface IEventMigrationPropertyBuilder

Namespace
Cratis.Chronicle.Events.Migrations
Assembly
Cratis.Chronicle.dll

Defines a builder for event migration property transformations.

public interface IEventMigrationPropertyBuilder
Extension Methods

Remarks

Property arguments are serialized JSON paths and are preserved exactly as supplied, including casing and explicit JSON property names. No naming policy is applied to these raw strings. For automatic name resolution, use typed member accessors through IEventMigrationPropertyBuilder<TTarget, TSource> instead. Separators, default values, and mapped values are literals and are not renamed.

Methods

Combine(PropertyName, PropertySeparator, params PropertyName[])

Combine multiple source properties into a single target property by concatenation.

void Combine(PropertyName targetProperty, PropertySeparator separator, params PropertyName[] sourceProperties)

Parameters

targetProperty PropertyName

The JSON property path to write the combined result into.

separator PropertySeparator

The separator to use between the combined values.

sourceProperties PropertyName[]

The JSON source property paths to concatenate.

DefaultValue(PropertyName, object)

Provide a default value for a new property that did not exist in the source generation.

void DefaultValue(PropertyName targetProperty, object value)

Parameters

targetProperty PropertyName

The JSON property path to set the default value on.

value object

The default value.

MapValues(PropertyName, PropertyName, IEnumerable<ValueMapping>)

Translate the individual values of a property that mean something different in the target generation.

void MapValues(PropertyName targetProperty, PropertyName sourceProperty, IEnumerable<ValueMapping> mappings)

Parameters

targetProperty PropertyName

The JSON property path to write the translated value into.

sourceProperty PropertyName

The JSON source property path to read the value from.

mappings IEnumerable<ValueMapping>

The values that change meaning, and what they become.

Remarks

A value no mapping mentions is carried across unchanged, and so is the value of a payload that does not carry the source property at all.

RenamedFrom(PropertyName, PropertyName)

Rename a property from an old name to a new target property.

void RenamedFrom(PropertyName targetProperty, PropertyName oldName)

Parameters

targetProperty PropertyName

The JSON target property path.

oldName PropertyName

The JSON source property path to read from.

Split(PropertyName, PropertyName, PropertySeparator, SplitPartIndex)

Split a source property value into a target property by extracting one part.

void Split(PropertyName targetProperty, PropertyName sourceProperty, PropertySeparator separator, SplitPartIndex part)

Parameters

targetProperty PropertyName

The JSON property path to write the split result into.

sourceProperty PropertyName

The JSON source property path to split.

separator PropertySeparator

The separator to use.

part SplitPartIndex

The zero-based part index to extract.