public static Commit CommitNext(this IPersistStreams persistence, Commit previous) { Commit commit = previous.BuildNextAttempt(); persistence.Commit(commit); return(commit); }
protected override void Context() { _now = SystemTime.UtcNow.AddYears(1); _first = Guid.NewGuid().BuildAttempt(_now.AddSeconds(1)); _second = _first.BuildNextAttempt(); _third = _second.BuildNextAttempt(); _fourth = _third.BuildNextAttempt(); _fifth = Guid.NewGuid().BuildAttempt(_now.AddSeconds(1)); _persistence1 = Partitions.NewEventStoreWithPartition(); _persistence2 = Partitions.NewEventStoreWithPartition(); _persistence1.Commit(_first); _persistence1.Commit(_second); _persistence1.Commit(_third); _persistence1.Commit(_fourth); _persistence2.Commit(_fifth); }
protected override void Context() { now = SystemTime.UtcNow.AddYears(1); first = Guid.NewGuid().BuildAttempt(now.AddSeconds(1)); second = first.BuildNextAttempt(); third = second.BuildNextAttempt(); fourth = third.BuildNextAttempt(); fifth = Guid.NewGuid().BuildAttempt(now.AddSeconds(1)); persistence1 = Partitions.NewEventStoreWithPartition(); persistence2 = Partitions.NewEventStoreWithPartition(); persistence1.Commit(first); persistence1.Commit(second); persistence1.Commit(third); persistence1.Commit(fourth); persistence2.Commit(fifth); }
public static IEnumerable <Commit> CommitMany(this IPersistStreams persistence, int numberOfCommits, string streamId = null) { var commits = new List <Commit>(); Commit attempt = null; for (int i = 0; i < numberOfCommits; i++) { attempt = attempt == null ? (streamId ?? Guid.NewGuid().ToString()).BuildAttempt() : attempt.BuildNextAttempt(); persistence.Commit(attempt); commits.Add(attempt); } return(commits); }
public static void CommitMany(this IPersistStreams persistence, int numberOfCommits, Guid?streamId = null) { Commit attempt = null; for (int i = 0; i < numberOfCommits; i++) { attempt = attempt == null ? (streamId ?? Guid.NewGuid()).BuildAttempt() : attempt.BuildNextAttempt(); persistence.Commit(attempt); } }