/// <summary> /// 构造函数 /// </summary> /// <param name="name">链接名称</param> /// <param name="isolationLevel">事务级别</param> public TransactionConnection(string name, IsolationLevel?isolationLevel = null) { Connection = ConnectionFactory.GetConnection(name); Command = Connection.CreateCommand(); Transaction = isolationLevel.HasValue ? Connection.BeginTransaction(isolationLevel.Value) : Connection.BeginTransaction(); }