Exemple #1
0
 private RillDetails(
     RillReference reference,
     Sequence sequence,
     Timestamp createdAt,
     Timestamp lastChangedAt)
 {
     Reference     = reference;
     Sequence      = sequence;
     CreatedAt     = createdAt;
     LastChangedAt = lastChangedAt;
 }
Exemple #2
0
        public static RillDetails From(
            RillReference reference,
            Sequence sequence,
            Timestamp createdAt,
            Timestamp lastChangedAt)
        {
            if (lastChangedAt < createdAt)
            {
                throw new ArgumentException("Last changed can not take presence before Created timestamp.");
            }

            return(new RillDetails(reference, sequence, createdAt, lastChangedAt));
        }
Exemple #3
0
 private RillCommit(
     RillReference reference,
     CommitId id,
     SequenceRange sequenceRange,
     Timestamp timestamp,
     IImmutableList <Event> events)
 {
     Id            = id;
     Reference     = reference;
     SequenceRange = sequenceRange;
     Timestamp     = timestamp;
     Events        = events;
 }
Exemple #4
0
        public static RillDetails New(RillReference reference, Timestamp?timestamp = default)
        {
            var ts = timestamp ?? Timestamp.New();

            return(new RillDetails(reference, Sequence.None, ts, ts));
        }
Exemple #5
0
 public static IRill Synchronous(RillReference reference) => new SynchronousRill(reference);
Exemple #6
0
 public static IAsyncRill Asynchronous(RillReference reference) => new AsynchronousRill(reference);
Exemple #7
0
 public static RillCommit From(
     RillReference reference,
     CommitId id,
     SequenceRange sequenceRange,
     Timestamp timestamp,
     IImmutableList <Event> events) => new(reference, id, sequenceRange, timestamp, RequireAtLeastOneEvent(events));