예제 #1
0
파일: Transaction.cs 프로젝트: ONE75/ScrumR
        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();
            }
        }
예제 #2
0
파일: Transaction.cs 프로젝트: ONE75/ScrumR
        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");
            }
        }