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

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