Class EventMigrationPropertyBuilder
- Namespace
- Cratis.Chronicle.Events.Migrations
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IEventMigrationPropertyBuilder.
public class EventMigrationPropertyBuilder : IEventMigrationPropertyBuilder
- Inheritance
-
EventMigrationPropertyBuilder
- Implements
- Inherited Members
- Extension Methods
Constructors
EventMigrationPropertyBuilder()
Initializes a new instance of EventMigrationPropertyBuilder using the default naming policy.
public EventMigrationPropertyBuilder()
EventMigrationPropertyBuilder(INamingPolicy?)
Represents an implementation of IEventMigrationPropertyBuilder.
public EventMigrationPropertyBuilder(INamingPolicy? namingPolicy)
Parameters
namingPolicyINamingPolicyThe naming policy for typed accessors. Raw property paths are preserved verbatim.
Properties
Properties
Gets the configured properties.
public IReadOnlyDictionary<PropertyExpression, JsonNode> Properties { get; }
Property Value
Methods
Combine(PropertyName, PropertySeparator, params PropertyName[])
Combine multiple source properties into a single target property by concatenation.
public void Combine(PropertyName targetProperty, PropertySeparator separator, params PropertyName[] sourceProperties)
Parameters
targetPropertyPropertyNameThe JSON property path to write the combined result into.
separatorPropertySeparatorThe separator to use between the combined values.
sourcePropertiesPropertyName[]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.
public void DefaultValue(PropertyName targetProperty, object value)
Parameters
targetPropertyPropertyNameThe JSON property path to set the default value on.
valueobjectThe default value.
MapValues(PropertyName, PropertyName, IEnumerable<ValueMapping>)
Translate the individual values of a property that mean something different in the target generation.
public void MapValues(PropertyName targetProperty, PropertyName sourceProperty, IEnumerable<ValueMapping> mappings)
Parameters
targetPropertyPropertyNameThe JSON property path to write the translated value into.
sourcePropertyPropertyNameThe JSON source property path to read the value from.
mappingsIEnumerable<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.
public void RenamedFrom(PropertyName targetProperty, PropertyName oldName)
Parameters
targetPropertyPropertyNameThe JSON target property path.
oldNamePropertyNameThe 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.
public void Split(PropertyName targetProperty, PropertyName sourceProperty, PropertySeparator separator, SplitPartIndex part)
Parameters
targetPropertyPropertyNameThe JSON property path to write the split result into.
sourcePropertyPropertyNameThe JSON source property path to split.
separatorPropertySeparatorThe separator to use.
partSplitPartIndexThe zero-based part index to extract.