Exemplo n.º 1
0
 private SimpleTransaction(IAdapterWithTransactions adapter, Database database)
 {
     if (adapter == null) throw new ArgumentNullException("adapter");
     if (database == null) throw new ArgumentNullException("database");
     _adapter = adapter;
     _database = database;
 }
Exemplo n.º 2
0
 private SimpleTransaction(SimpleTransaction copy) : base(copy)
 {
     _adapter = copy._adapter;
     _database = copy._database;
     _adapterTransaction = copy._adapterTransaction;
     _transactionRunner = copy._transactionRunner;
 }
 public void UseMockDatabase(Database database)
 {
     _openDefault = _openFile = _openConnection = _openNamedConnection = ignore => database;
     _open = (ignore1, ignore2) => database;
     _openNamedConnectionAndSchema = _openConnectionWithProvider = (ignore1, ignore2) => database;
     _openConnectionWithProviderAndSchema = (ignore1, ignore2, ignore3) => database;
 }
Exemplo n.º 4
0
 internal static SimpleTransaction Begin(Database database, string name)
 {
     SimpleTransaction transaction = CreateTransaction(database);
     transaction.Begin(name);
     return transaction;
 }
 public SimpleDataRepositoryHelper(Database database, string schema = "", int maxRetries = 3, SimpleDataMode mode = SimpleDataMode.Test)
     : base(database, schema, maxRetries, mode)
 {
 }
Exemplo n.º 6
0
 private static SimpleTransaction CreateTransaction(Database database)
 {
     var adapterWithTransactions = database.GetAdapter() as IAdapterWithTransactions;
     if (adapterWithTransactions == null) throw new NotSupportedException();
     return new SimpleTransaction(adapterWithTransactions, database);
 }
Exemplo n.º 7
0
 public static void UseMockDatabase(Database database)
 {
     _openDefault = () => database;
     _openFile = _openConnection = _openNamedConnection = (ignore) => database;
     _open = (ignore1, ignore2) => database;
     _openConnectionWithProvider = (ignore1, ignore2) => database;
 }
Exemplo n.º 8
0
 public SimpleRecord(Database database)
 {
     _data = new HomogenizedKeyDictionary();
     _database = database;
 }
Exemplo n.º 9
0
 public static void UseMockDatabase(Database database)
 {
     OpenMethods.UseMockDatabase(database);
 }
 protected OracleSimpleDataRepository(Database database, string schema = "", int maxRetries = 3, SimpleDataMode mode = SimpleDataMode.Live) : base(database, schema, maxRetries, mode)
 {
 }
Exemplo n.º 11
0
 internal DynamicRecord(IEnumerable<KeyValuePair<string, object>> data, string tableName, Database database)
 {
     _tableName = tableName;
     _database = database;
     _data = new HomogenizedKeyDictionary(data);
 }
Exemplo n.º 12
0
 public DynamicRecord(Database database)
 {
     _data = new HomogenizedKeyDictionary();
     _database = database;
 }
Exemplo n.º 13
0
 public static void UseMockDatabase(Database database)
 {
     _openDefault = () => database;
     _openFile = _openConnection = (ignore) => database;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicTable"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="database">The database which owns the table.</param>
 public DynamicTable(string tableName, Database database)
 {
     _tableName = tableName;
     _database = database;
 }
Exemplo n.º 15
0
 public static SimpleTransaction Begin(Database database, IsolationLevel isolationLevel)
 {
     var transaction = CreateTransaction(database, isolationLevel);
     transaction.Begin();
     return transaction;
 }
Exemplo n.º 16
0
 private Database(Database copy) : base(copy)
 {
     _adapter = copy._adapter;
     _databaseRunner = copy._databaseRunner;
 }
Exemplo n.º 17
0
 private static SimpleTransaction CreateTransaction(Database database, IsolationLevel isolationLevel = IsolationLevel.Unspecified)
 {
     var adapterWithTransactions = database.GetAdapter() as IAdapterWithTransactions;
     if (adapterWithTransactions == null) throw new NotSupportedException();
     return new SimpleTransaction(adapterWithTransactions, database, isolationLevel);
 }
Exemplo n.º 18
0
 protected Command(Database database, string tableName)
 {
     _tableName = tableName;
     _database = database;
 }