public void FrameLogMakesUseOfDbContextTransaction()
        {
            Book book;
            var db2 = new ExampleContext();
            using (var transaction = db.Database.BeginTransaction())
            {
                book = new Book() { Title = "Title" };
                db.Books.Add(book);
                db.Logger.SaveChangesWithinExplicitTransaction(user);

                Assert.IsNull(db2.Books.SingleOrDefault(b => b.Id == book.Id));
                transaction.Commit();
            }
            Assert.IsNotNull(db2.Books.SingleOrDefault(b => b.Id == book.Id));
        }
 public void CreateContext()
 {
     db = makeDatabase();
     setupWithDatabase(db);
 }
 protected ChangeSet lastChangeSet(ExampleContext db = null)
 {
     return (db ?? this.db).ChangeSets.OrderByDescending(c => c.Timestamp).First();
 }
 protected virtual void setupWithDatabase(ExampleContext db)
 {
     //by default, do nothing
 }