public void Transaction_is_rolled_back_if_something_happens() { using (var scope = new TransactionScope()) { var test = new JustATest { TestName = "testje" }; _session.Store(test); _session.SaveChanges(); throw new Exception("This is expected"); scope.Complete(); } }
public void JustWorksAsRegular() { using (var scope = new TransactionScope()) { var test = new JustATest { TestName = "testje" }; _session.Store(test); _session.SaveChanges(); scope.Complete(); Debug.WriteLine("test is stored"); } }