Table of Contents

Class SnapshotBuilder

Namespace
The.Model
Assembly
Instagile.Model.dll
public class SnapshotBuilder : IVisitor
Inheritance
SnapshotBuilder
Implements
Inherited Members

Constructors

SnapshotBuilder()

public SnapshotBuilder()

SnapshotBuilder(ModelSnapshot)

public SnapshotBuilder(ModelSnapshot existingModel)

Parameters

existingModel ModelSnapshot

Methods

Build()

public ModelSnapshot Build()

Returns

ModelSnapshot

BuildEmpty()

Create an empty snapshot with no CreateModel event

public static ModelSnapshot BuildEmpty()

Returns

ModelSnapshot

BuildFromEvents(IEnumerable<IEvent>)

public static ModelSnapshot BuildFromEvents(IEnumerable<IEvent> events)

Parameters

events IEnumerable<IEvent>

Returns

ModelSnapshot

BuildFromEvents(IEnumerable<IEvent>, CancellationToken)

Create a model snapshot from model event history

public static ModelSnapshot BuildFromEvents(IEnumerable<IEvent> events, CancellationToken cancellationToken)

Parameters

events IEnumerable<IEvent>
cancellationToken CancellationToken

Returns

ModelSnapshot

Exceptions

InvalidEventException

Thrown when processing the history would produce an invalid state

OperationCanceledException

Thrown when the cancellation token's source is cancelled.

BuildFromModelAndChanges(ModelSnapshot, IEnumerable<IEvent>, IProgress<IEvent>?)

public static ModelSnapshot BuildFromModelAndChanges(ModelSnapshot existingModel, IEnumerable<IEvent> events, IProgress<IEvent>? progress = null)

Parameters

existingModel ModelSnapshot
events IEnumerable<IEvent>
progress IProgress<IEvent>

Returns

ModelSnapshot

BuildFromModelAndChanges(ModelSnapshot, IEnumerable<IEvent>, CancellationToken, IProgress<IEvent>?)

public static ModelSnapshot BuildFromModelAndChanges(ModelSnapshot existingModel, IEnumerable<IEvent> events, CancellationToken cancellationToken, IProgress<IEvent>? progress = null)

Parameters

existingModel ModelSnapshot
events IEnumerable<IEvent>
cancellationToken CancellationToken
progress IProgress<IEvent>

Returns

ModelSnapshot

BuildHistoricalVersions(IEnumerable<IEvent>)

Create a model snapshot from model event history

public static IReadOnlyDictionary<Version, ModelSnapshot> BuildHistoricalVersions(IEnumerable<IEvent> events)

Parameters

events IEnumerable<IEvent>

Returns

IReadOnlyDictionary<Version, ModelSnapshot>

Exceptions

InvalidEventException

Thrown when processing the history would produce an invalid state

ToString()

public override string ToString()

Returns

string

Visit(CopyAttributesV1Event)

public void Visit(CopyAttributesV1Event e)

Parameters

e CopyAttributesV1Event

Visit(CopyAttributesV2Event)

public void Visit(CopyAttributesV2Event e)

Parameters

e CopyAttributesV2Event

Visit(CopyAttributesV3Event)

public void Visit(CopyAttributesV3Event e)

Parameters

e CopyAttributesV3Event

Visit(CopyForeignKeyV1Event)

public void Visit(CopyForeignKeyV1Event e)

Parameters

e CopyForeignKeyV1Event

Visit(CopyForeignKeyV2Event)

public void Visit(CopyForeignKeyV2Event e)

Parameters

e CopyForeignKeyV2Event

Visit(CopyRelationshipV1Event)

public void Visit(CopyRelationshipV1Event e)

Parameters

e CopyRelationshipV1Event

Visit(TagRelationshipSideV1Event)

public void Visit(TagRelationshipSideV1Event e)

Parameters

e TagRelationshipSideV1Event