Table of Contents

Interface IRecordV2Delta

Namespace
PushTechnology.ClientInterface.Data.Record
Assembly
Diffusion.Client.dll

The IRecordV2 structural delta.

public interface IRecordV2Delta

Examples

RecordV2Deltas are useful for identifying small changes to complex RecordV2 values. Here's an example of how to use this class to filter interesting changes in a ValueStream.

public class ExampleStream : IValueStream<IRecordV2> {
    public void OnValue( string topicPath, ITopicSpecification specification, IRecordV2 oldValue, IRecordV2 newValue ) {
        var delta = newValue.Diff( oldValue );

        foreach ( var change in delta.Changes( schema ) ) {
            if ( change.FieldName == "address" ) {
                ProcessAddress( newValue );
            }
        }
        // ...
    }
    // ...
}

Remarks

A IRecordV2Delta describes the differences between two IRecordV2 values. Unlike a IBinaryDelta, a structural delta can be queried to determine its effect. The Changes(ISchema) method provides details of which values have changed.

An instance can be created from two IRecordV2 values using Diff(IRecordV2).

Implemented in Version 6.0.

Methods

Changes(ISchema)

Returns a list of the changes represented by the delta with reference to a specified schema.

IReadOnlyList<IChange> Changes(ISchema schema)

Parameters

schema ISchema

The schema.

Returns

IReadOnlyList<IChange>

The immutable list of changes.

Remarks

The schema supplied must comply with the data format of the delta. No validation takes place, so if the schema does not match the data then the results may be unpredictable.