Пример #1
0
		public void TestContext()
		{
			var ctx = new DataContext("Sql2008");

			ctx.GetTable<Person>().ToList();

			ctx.KeepConnectionAlive = true;

			ctx.GetTable<Person>().ToList();
			ctx.GetTable<Person>().ToList();

			ctx.KeepConnectionAlive = false;

			using (var tran = new DataContextTransaction(ctx))
			{
				ctx.GetTable<Person>().ToList();

				tran.BeginTransaction();

				ctx.GetTable<Person>().ToList();
				ctx.GetTable<Person>().ToList();

				tran.CommitTransaction();
			}
		}
Пример #2
0
        public DataContextTransaction BeginTransaction()
        {
            var dct = new DataContextTransaction(this);

            dct.BeginTransaction();

            return(dct);
        }
Пример #3
0
        public DataContextTransaction BeginTransaction(IsolationLevel level)
        {
            var dct = new DataContextTransaction(this);

            dct.BeginTransaction(level);

            return(dct);
        }
Пример #4
0
		public DataContextTransaction BeginTransaction()
		{
			var dct = new DataContextTransaction(this);

			dct.BeginTransaction();

			return dct;
		}
Пример #5
0
		public DataContextTransaction BeginTransaction(IsolationLevel level)
		{
			var dct = new DataContextTransaction(this);

			dct.BeginTransaction(level);

			return dct;
		}