Skip to content

Commit

Permalink
Always order events by timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Lycken committed Nov 1, 2017
1 parent 950a958 commit b24d2c3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public async Task<IEnumerable<TEvent>> Events(Func<IQueryable<TEventMetadata>, I
var storedEvents = await context.Events
.AsNoTracking()
.Apply(query)
.OrderBy(e => e.Timestamp)
.ToListAsync();

var events = storedEvents
Expand All @@ -52,7 +53,9 @@ public async Task<IEnumerable<TEvent>> Events(TStreamId streamId, Func<IQueryabl
.Where(e => e.StreamId.Equals(streamId))
.AsNoTracking()
.Apply(query)
.OrderBy(e => e.Timestamp)
.ToListAsync();

var events = storedEvents
.Cast<TPersistedEvent>()
.Select(_serializer.Deserialize);
Expand Down

0 comments on commit b24d2c3

Please sign in to comment.