Table of Contents

Class AggregateRootCommitResult

Namespace
Cratis.Chronicle.Aggregates
Assembly
Cratis.Chronicle.dll

Represents the result of committing an IAggregateRoot.

public class AggregateRootCommitResult
Inheritance
AggregateRootCommitResult
Inherited Members

Properties

ConstraintViolations

Gets the constraint violations that occurred during the commit.

public IEnumerable<ConstraintViolation> ConstraintViolations { get; init; }

Property Value

IEnumerable<ConstraintViolation>

Errors

Gets any exception messages that might have occurred.

public IEnumerable<AppendError> Errors { get; init; }

Property Value

IEnumerable<AppendError>

Events

Gets list of committed events ordered by their sequence number.

public IEnumerable<object> Events { get; init; }

Property Value

IEnumerable<object>

IsSuccess

Gets a value indicating whether the commit was successful.

public bool IsSuccess { get; }

Property Value

bool

Methods

CreateFrom(IUnitOfWork)

public static AggregateRootCommitResult CreateFrom(IUnitOfWork unitOfWork)

Parameters

unitOfWork IUnitOfWork

IUnitOfWork to create from.

Returns

AggregateRootCommitResult

A new instance of AggregateRootCommitResult.

Successful(IImmutableList<object>?)

Create a successful AggregateRootCommitResult.

public static AggregateRootCommitResult Successful(IImmutableList<object>? events = null)

Parameters

events IImmutableList<object>

Collection of events.

Returns

AggregateRootCommitResult

AggregateRootCommitResult.

Operators

implicit operator bool(AggregateRootCommitResult)

Implicitly convert from AggregateRootCommitResult to bool.

public static implicit operator bool(AggregateRootCommitResult result)

Parameters

result AggregateRootCommitResult

The AggregateRootCommitResult.

Returns

bool