/// <summary> /// Initializes a new instance of the ConnectionData class. /// </summary> /// <param name="connectionString">A connection string.</param> /// <param name="commandTimeout">A command timeout.</param> /// <param name="massDataOperationIsolationLevel">An isolation level of a CRUD mass data operation.</param> public ConnectionData(string connectionString, int commandTimeout = 30, QueryTalk.Designer.IsolationLevel massDataOperationIsolationLevel = QueryTalk.Designer.IsolationLevel.ReadCommitted) { if (connectionString == null) { throw ArgumentUndefinedException(); } ConnectionString = connectionString; _commandTimeout = commandTimeout; _massDataOperationIsolationLevel = massDataOperationIsolationLevel; }
/// <summary> /// Begins the transactional SQL batch. /// </summary> /// <param name="name">The name of the batch.</param> /// <param name="embeddedTransactionIsolationLevel">Defines the transaction isolation level of the batch.</param> public static NameChainer As(string name, QueryTalk.Designer.IsolationLevel embeddedTransactionIsolationLevel = IsolationLevel.Default) { return(Call <NameChainer>(Assembly.GetCallingAssembly(), (ca) => { if (name == null) { _Throw(QueryTalkExceptionType.ArgumentNull, "name", ".As"); } var root = new d(); root.Name = name; return new NameChainer(root, embeddedTransactionIsolationLevel); })); }
// converts QueryTalk.Designer.IsolationLevel into SQL code presentation internal static string ToSql(this QueryTalk.Designer.IsolationLevel isolationLevel) { switch (isolationLevel) { case Designer.IsolationLevel.ReadCommitted: return(Text.ReadCommitted); case Designer.IsolationLevel.ReadUncommitted: return(Text.ReadUncommitted); case Designer.IsolationLevel.RepeatableRead: return(Text.RepeatableRead); case Designer.IsolationLevel.Snapshot: return(Text.Snapshot); case Designer.IsolationLevel.Serializable: return(Text.Serializable); default: return(Text.ReadCommitted); } }
// converts QueryTalk.Designer.IsolationLevel into System.Transactions.IsolationLevel internal static System.Transactions.IsolationLevel ToSystemEnum(this QueryTalk.Designer.IsolationLevel isolationLevel) { switch (isolationLevel) { case Designer.IsolationLevel.ReadCommitted: return(System.Transactions.IsolationLevel.ReadCommitted); case Designer.IsolationLevel.ReadUncommitted: return(System.Transactions.IsolationLevel.ReadUncommitted); case Designer.IsolationLevel.RepeatableRead: return(System.Transactions.IsolationLevel.RepeatableRead); case Designer.IsolationLevel.Serializable: return(System.Transactions.IsolationLevel.Serializable); case Designer.IsolationLevel.Snapshot: return(System.Transactions.IsolationLevel.Snapshot); default: return(System.Transactions.IsolationLevel.Unspecified); // will not happen } }