Table of Contents

Interface IChangeRepository

Namespace
Shift.Common.Timeline.Changes
Assembly
Shift.Common.dll

Provides functionality to get and save aggregates.

public interface IChangeRepository
Extension Methods

Methods

Box<T>(T)

Copies an aggregate to offline storage and removes it from online logs.

void Box<T>(T aggregate) where T : AggregateRoot

Parameters

aggregate T

Type Parameters

T

Exists<T>(Guid)

Returns true if an aggregate exists.

bool Exists<T>(Guid id)

Parameters

id Guid

Returns

bool

Type Parameters

T

GetClone<T>(Guid, int?)

T GetClone<T>(Guid aggregateId, int? version = -1) where T : AggregateRoot

Parameters

aggregateId Guid
version int?

Returns

T

Type Parameters

T

GetPrevAndCurrentStates(Guid, int)

(AggregateState prev, AggregateState current) GetPrevAndCurrentStates(Guid aggregateId, int version)

Parameters

aggregateId Guid
version int

Returns

(AggregateState prev, AggregateState current)

GetStatesAndChanges(Guid)

IChange[] GetStatesAndChanges(Guid aggregateId)

Parameters

aggregateId Guid

Returns

IChange[]

Get<T>(Guid, int?)

Returns a specific aggregate.

T Get<T>(Guid id, int? expectedVersion = -1) where T : AggregateRoot

Parameters

id Guid
expectedVersion int?

Returns

T

Type Parameters

T

LockAndRun<T>(Guid, Action<T>)

void LockAndRun<T>(Guid aggregateId, Action<T> action) where T : AggregateRoot

Parameters

aggregateId Guid
action Action<T>

Type Parameters

T

Peek<T>(Guid, int)

Returns a specific aggregate as at a specific version.

T Peek<T>(Guid id, int asAtVersion) where T : AggregateRoot

Parameters

id Guid
asAtVersion int

Returns

T

Type Parameters

T

Save<T>(T, int?)

Saves an aggregate.

IChange[] Save<T>(T aggregate, int? expectedVersion = null) where T : AggregateRoot

Parameters

aggregate T
expectedVersion int?

Returns

IChange[]

Returns the changes that are now saved (and ready to be published).

Type Parameters

T

Unbox<T>(Guid)

Retrieves an aggregate from offline storage and returns only its most recent state.

T Unbox<T>(Guid aggregate) where T : AggregateRoot

Parameters

aggregate Guid

Returns

T

Type Parameters

T