public async Task Given_IncludedCollection_Should_TimeTravelIncludedCollection() { var context = TestHelper.GetNewDbContext(); var appleId = Guid.Parse("00000003-8803-4263-ada6-cd12a33d8872"); var apple = new Apple { Id = appleId, FruitStatus = FruitStatus.Rotten }; apple.AddWorm("Gav"); context.Apples.Add(apple); await context.SaveChangesAsync(); var rottenAppleTime = TestHelper.UtcNow; context = TestHelper.GetNewDbContext(); apple = await context.Apples.SingleAsync(a => a.Id == appleId); apple.AddWorm("G-Dog"); apple.AddWorm("Gavin' A Laugh"); await context.SaveChangesAsync(); context = TestHelper.GetNewDbContext(); var currentApple = await context.Apples .Include(a => a.Worms) .SingleAsync(a => a.Id == appleId); currentApple.Worms.Count.Should().Be(3); using (TemporalQuery.AsOf(rottenAppleTime)) { // Let's use the same context for time travel var timeTravelApple = await context.Apples .Include(a => a.Worms) // All temporal queries must be .AsNoTracking() .AsNoTracking() .SingleAsync(a => a.Id == appleId); timeTravelApple.Worms.Count.Should().Be(1); } }