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
Errors
Gets any exception messages that might have occurred.
public IEnumerable<AppendError> Errors { get; init; }
Property Value
Events
Gets list of committed events ordered by their sequence number.
public IEnumerable<object> Events { get; init; }
Property Value
IsSuccess
Gets a value indicating whether the commit was successful.
public bool IsSuccess { get; }
Property Value
Methods
CreateFrom(IUnitOfWork)
Create an AggregateRootCommitResult from IUnitOfWork.
public static AggregateRootCommitResult CreateFrom(IUnitOfWork unitOfWork)
Parameters
unitOfWork
IUnitOfWorkIUnitOfWork 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
Operators
implicit operator bool(AggregateRootCommitResult)
Implicitly convert from AggregateRootCommitResult to bool.
public static implicit operator bool(AggregateRootCommitResult result)
Parameters
result
AggregateRootCommitResult