public void UseMockAdapter(Adapter adapter)
 {
     _openDefault = _openFile = _openConnection = _openNamedConnection = ignore => new Database(adapter);
     _open = (ignore1, ignore2) => new Database(adapter);
     _openNamedConnectionAndSchema = _openConnectionWithProvider = (ignore1, ignore2) => new Database(adapter);
     _openConnectionWithProviderAndSchema = (ignore1, ignore2, ignore3) => new Database(adapter);
 }
Exemple #2
0
 public static void UseMockAdapter(Adapter mockAdapter)
 {
     Data.DatabaseOpener.UseMockAdapter(mockAdapter);
 }
 public static void UseMockAdapter(Adapter adapter)
 {
     _openDefault = () => new Database(adapter);
     _openFile = _openConnection = _openNamedConnection = (ignore) => new Database(adapter);
     _open = (ignore1, ignore2) => new Database(adapter);
     _openConnectionWithProvider = (ignore1, ignore2) => new Database(adapter);
 }
Exemple #4
0
 private Database(Database copy) : base(copy)
 {
     _adapter = copy._adapter;
     _databaseRunner = copy._databaseRunner;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Database"/> class.
 /// </summary>
 /// <param name="adapter">The adapter to use for data access.</param>
 internal Database(Adapter adapter)
 {
     _adapter = adapter;
     _databaseRunner = new DatabaseRunner(_adapter);
 }
 public static void UseMockAdapter(Adapter adapter)
 {
     OpenMethods.UseMockAdapter(adapter);
 }
 public virtual Func<object[], IDictionary<string, object>> CreateFindOneDelegate(Adapter adapter, string tableName, SimpleExpression criteria)
 {
     return adapter.CreateFindOneDelegate(tableName, criteria);
 }
 public DatabaseRunner(Adapter adapter)
 {
     _adapter = adapter;
 }
 public DatabaseRunner(Adapter adapter)
 {
     _adapter = adapter;
 }
 public virtual Func<object[], IDictionary<string,object>> CreateGetDelegate(Adapter adapter, string tableName, object[] keyValues)
 {
     return args => adapter.Get(tableName, args);
 }
 public static void UseMockAdapter(Adapter adapter)
 {
     OpenMethods.UseMockAdapter(adapter);
 }
Exemple #12
0
 public virtual Func <object[], IDictionary <string, object> > CreateFindOneDelegate(Adapter adapter, string tableName, SimpleExpression criteria)
 {
     return(adapter.CreateFindOneDelegate(tableName, criteria));
 }
Exemple #13
0
 public virtual Func <object[], IDictionary <string, object> > CreateGetDelegate(Adapter adapter, string tableName, object[] keyValues)
 {
     return(args => adapter.Get(tableName, args));
 }
Exemple #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Database"/> class.
 /// </summary>
 /// <param name="adapter">The adapter to use for data access.</param>
 internal Database(Adapter adapter)
 {
     _adapter = adapter;
 }
 public static void UseMockAdapter(Adapter adapter)
 {
     _openDefault = () => new Database(adapter);
     _openFile = _openConnection = (ignore) => new Database(adapter);
 }
 public AdapterMethodDynamicInvoker(Adapter adapter)
 {
     _adapter = adapter;
 }
Exemple #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Database"/> class.
 /// </summary>
 /// <param name="adapter">The adapter to use for data access.</param>
 internal Database(Adapter adapter)
 {
     _adapter = adapter;
 }