GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Simple.Data/Simple.Data/DatabaseOpenerMethods.cs at master · ThatRendle/Simple.Data

Expand file tree

/

DatabaseOpenerMethods.cs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
96 lines (82 loc) · 4.22 KB
/

DatabaseOpenerMethods.cs

Copy path

File metadata and controls

96 lines (82 loc) · 4.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
namespace Simple.Data
{
using System;
internal class DatabaseOpenerMethods
{
private Func<string, Database> _openDefault;
private Func<string, Database> _openFile;
private Func<string, Database> _openConnection;
private Func<string, string, Database> _openConnectionWithProvider;
private Func<string, string, string, Database> _openConnectionWithProviderAndSchema;
private Func<string, Database> _openNamedConnection;
private Func<string, string, Database> _openNamedConnectionAndSchema;
private Func<string, object, Database> _open;
public Func<string, Database> OpenDefaultImpl
{
get { return _openDefault ?? DatabaseOpener.OpenDefaultMethod; }
}
public Func<string, Database> OpenFileImpl
{
get { return _openFile ?? DatabaseOpener.OpenFileMethod; }
}
public Func<string, Database> OpenConnectionImpl
{
get { return _openConnection ?? DatabaseOpener.OpenConnectionMethod; }
}
public Func<string, string, Database> OpenConnectionWithProviderImpl
{
get { return _openConnectionWithProvider ?? DatabaseOpener.OpenConnectionMethod; }
}
public Func<string, string, string, Database> OpenConnectionWithProviderAndSchemaImpl
{
get { return _openConnectionWithProviderAndSchema ?? DatabaseOpener.OpenConnectionAndSchemaMethod; }
}
public Func<string, Database> OpenNamedConnectionImpl
{
get { return _openNamedConnection ?? DatabaseOpener.OpenNamedConnectionMethod; }
}
public Func<string, string, Database> OpenNamedConnectionAndSchemaImpl
{
get { return _openNamedConnectionAndSchema ?? DatabaseOpener.OpenNamedConnectionAndSchemaMethod; }
}
public Func<string, object, Database> OpenImpl
{
get { return _open ?? DatabaseOpener.OpenMethod; }
}
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;
}
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);
}
public void UseMockDatabase(Func<Database> databaseCreator)
{
_openDefault = _openFile = _openConnection = _openNamedConnection = ignore => databaseCreator();
_open = (ignore1, ignore2) => databaseCreator();
_openNamedConnectionAndSchema = _openConnectionWithProvider = (ignore1, ignore2) => databaseCreator();
_openConnectionWithProviderAndSchema = (ignore1, ignore2, ignore3) => databaseCreator();
}
public void UseMockAdapter(Func<Adapter> adapterCreator)
{
_openDefault = _openFile = _openConnection = _openNamedConnection = ignore => new Database(adapterCreator());
_open = (ignore1, ignore2) => new Database(adapterCreator());
_openNamedConnectionAndSchema = _openConnectionWithProvider = (ignore1, ignore2) => new Database(adapterCreator());
_openConnectionWithProviderAndSchema = (ignore1, ignore2, ignore3) => new Database(adapterCreator());
}
public void StopUsingMock()
{
_openDefault = _openFile = _openConnection = _openNamedConnection = null;
_open = null;
_openNamedConnectionAndSchema = _openConnectionWithProvider = null;
_openConnectionWithProviderAndSchema = null;
}
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.