Interface IChangeStore
Defines the methods needed from the change store.
public interface IChangeStore
- Extension Methods
Methods
Box(Guid, bool)
Copies an aggregate to offline storage and removes it from online logs.
void Box(Guid aggregate, bool archive)
Parameters
Remarks
Someone who is a purist with regard to change sourcing will red-flag this function and say the change stream for an aggregate should never be altered or removed. However, we have two scenarios in which this is a non- negotiable business requirement. First, when a customer does not renew their contract with our business, we have a contractual obligation to remove all the customer's data from our systems. Second, we frequently run test-cases to confirm system functions are operating correctly; this data is temporary by definition, and we do not want to permanently store the change streams for test aggregates.
Count(Guid, int)
Gets count of changes for an aggregate.
int Count(Guid aggregate, int fromVersion = -1)
Parameters
Returns
Count(Guid, string, bool)
Used by ChangeGrid
int Count(Guid aggregate, string keyword, bool includeChildren)
Parameters
Returns
Count(string, IEnumerable<Guid>)
Gets count of changes for an aggregate.
int Count(string aggregateType, IEnumerable<Guid> aggregateIdentifiers)
Parameters
aggregateTypestringaggregateIdentifiersIEnumerable<Guid>
Returns
Exists(Guid, int)
Returns true if an aggregate with a specific version exists.
bool Exists(Guid aggregate, int version)
Parameters
Returns
Exists<T>(Guid)
Returns true if an aggregate exists.
bool Exists<T>(Guid aggregate)
Parameters
aggregateGuid
Returns
Type Parameters
T
GetAggregates(string)
Gets all the identifiers for a specific aggregate type.
List<Guid> GetAggregates(string aggregateType)
Parameters
aggregateTypestring
Returns
GetChange(Guid, int)
Gets a specific version of change for an aggregate.
IChange GetChange(Guid aggregate, int version)
Parameters
Returns
GetChanges(Guid, int)
Gets changes for an aggregate starting at a specific version. To get all changes use version = -1.
IChange[] GetChanges(Guid aggregate, int fromVersion)
Parameters
Returns
- IChange[]
GetChanges(Guid, int, int)
Gets changes for an aggregate within a specific range of versions.
IChange[] GetChanges(Guid aggregate, int fromVersion, int toVersion)
Parameters
Returns
- IChange[]
GetChanges(string, IEnumerable<Guid>)
Enumerate changes for all aggregates of a specific type.
List<IChange> GetChanges(string aggregateType, IEnumerable<Guid> aggregateIdentifiers)
Parameters
aggregateTypestringaggregateIdentifiersIEnumerable<Guid>
Returns
GetChanges(string, Guid?, IEnumerable<string>)
Gets changes for all aggregates of a specific type.
IChange[] GetChanges(string aggregateType, Guid? id, IEnumerable<string> changeTypes)
Parameters
aggregateTypestringidGuid?changeTypesIEnumerable<string>
Returns
- IChange[]
GetChangesPaged(Guid, string, bool, int, int)
Used in ChangeGrid
IChange[] GetChangesPaged(Guid aggregate, string keyword, bool includeChildren, int skip, int pageSize)
Parameters
Returns
- IChange[]
GetClassAndOrganization(Guid, out string, out Guid)
void GetClassAndOrganization(Guid aggregate, out string @class, out Guid organization)
Parameters
GetExpired(DateTimeOffset)
Gets all aggregates that are scheduled to expire at (or before) a specific time on a specific date.
Guid[] GetExpired(DateTimeOffset at)
Parameters
Returns
- Guid[]
GetSerializedChangesPaged(Guid, string, bool, int, int)
Gets serialized changes for all aggregates of a specific type.
List<SerializedChange> GetSerializedChangesPaged(Guid aggregate, string keyword, bool includeChildren, int skip, int pageSize)
Parameters
Returns
Insert(IChange, int)
Insert change into the stream at a specific position.
void Insert(IChange change, int index)
Parameters
Remarks
Aggregate change streams index from starting position 1 (not 0).
RegisterObsoleteChangeTypes(IEnumerable<string>)
Allows to mark a change as an obsolete ChangeStore doesn't try to deserialize an obsolete change and returns the change as SerializedChange This is useful when a specific change is obsolete and we need either ignore it or transform to a new change
void RegisterObsoleteChangeTypes(IEnumerable<string> changeTypes)
Parameters
changeTypesIEnumerable<string>
Rollback(Guid, int)
Performs a rollback on a specific aggregate to a specific version number. In simplest terms, this method deletes all the changes in an aggregate where the version number is greater than or equal to the input parameter.
int Rollback(Guid id, int version)
Parameters
Returns
Save(AggregateRoot, IEnumerable<IChange>)
Save changes.
void Save(AggregateRoot aggregate, IEnumerable<IChange> changes)
Parameters
aggregateAggregateRootchangesIEnumerable<IChange>
Save(IChange)
Save change.
void Save(IChange change)
Parameters
changeIChange
Save(IEnumerable<AggregateImport>)
void Save(IEnumerable<AggregateImport> import)
Parameters
importIEnumerable<AggregateImport>
Unbox(Guid, Func<Guid, AggregateRoot>)
void Unbox(Guid aggregate, Func<Guid, AggregateRoot> creator)
Parameters
aggregateGuidcreatorFunc<Guid, AggregateRoot>