Esempio n. 1
0
 private RillDetails(
     RillReference reference,
     Sequence sequence,
     Timestamp createdAt,
     Timestamp lastChangedAt)
 {
     Reference     = reference;
     Sequence      = sequence;
     CreatedAt     = createdAt;
     LastChangedAt = lastChangedAt;
 }
Esempio n. 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));
        }
Esempio n. 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;
 }
Esempio n. 4
0
        public static RillDetails New(RillReference reference, Timestamp?timestamp = default)
        {
            var ts = timestamp ?? Timestamp.New();

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