CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Data.ConnectionManager< C > Class Template Reference

Provides an automated way to reuse open database connections within the context of a single data portal operation. More...

Inheritance diagram for Csla.Data.ConnectionManager< C >:

Public Member Functions

void Dispose ()
 Dispose object, dereferencing or disposing the connection it is managing. More...
 
void Dispose ()
 Dispose object, dereferencing or disposing the connection it is managing. More...
 

Static Public Member Functions

static ConnectionManager GetManager (string database)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager GetManager (string database, string label)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager GetManager (string database, bool isDatabaseName)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager GetManager (string database, bool isDatabaseName, string label)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager< C > GetManager (string database)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager< C > GetManager (string database, string label)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager< C > GetManager (string database, bool isDatabaseName)
 Gets the ConnectionManager object for the specified database. More...
 
static ConnectionManager< C > GetManager (string database, bool isDatabaseName, string label)
 Gets the ConnectionManager object for the specified database. More...
 

Properties

IDbConnection Connection [get]
 Dispose object, dereferencing or disposing the connection it is managing. More...
 
int RefCount [get]
 Gets the current reference count for this object. More...
 
Connection [get]
 Gets the open database connection object. More...
 

Detailed Description

Provides an automated way to reuse open database connections within the context of a single data portal operation.

This type stores the open database connection in Csla.ApplicationContext.LocalContext and uses reference counting through IDisposable to keep the connection open for reuse by child objects, and to automatically dispose the connection when the last consumer has called Dispose." </remarks> </summary> <typeparam name="C"> Type of database connection object to use. </typeparam> <remarks> This type stores the open database connection in <see cref="Csla.ApplicationContext.LocalContext" /> and uses reference counting through <see cref="IDisposable" /> to keep the connection open for reuse by child objects, and to automatically dispose the connection when the last consumer has called Dispose."

Type Constraints
C :IDbConnection 
C :new() 

Definition at line 32 of file ConnectionManagerT.cs.

Member Function Documentation

◆ Dispose() [1/2]

void Csla.Data.ConnectionManager< C >.Dispose ( )

Dispose object, dereferencing or disposing the connection it is managing.

Definition at line 208 of file Csla/Data/ConnectionManager.cs.

◆ Dispose() [2/2]

void Csla.Data.ConnectionManager< C >.Dispose ( )

Dispose object, dereferencing or disposing the connection it is managing.

Definition at line 199 of file ConnectionManagerT.cs.

◆ GetManager() [1/8]

static ConnectionManager Csla.Data.ConnectionManager< C >.GetManager ( string  database)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 45 of file Csla/Data/ConnectionManager.cs.

◆ GetManager() [2/8]

static ConnectionManager< C > Csla.Data.ConnectionManager< C >.GetManager ( string  database)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 46 of file ConnectionManagerT.cs.

◆ GetManager() [3/8]

static ConnectionManager Csla.Data.ConnectionManager< C >.GetManager ( string  database,
bool  isDatabaseName 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the connection string should be retrieved from the config file. If False, the database parameter is directly used as a connection string.
Returns
ConnectionManager object for the name.

Definition at line 77 of file Csla/Data/ConnectionManager.cs.

◆ GetManager() [4/8]

static ConnectionManager< C > Csla.Data.ConnectionManager< C >.GetManager ( string  database,
bool  isDatabaseName 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the connection string should be retrieved from the config file. If False, the database parameter is directly used as a connection string.
Returns
ConnectionManager object for the name.

Definition at line 78 of file ConnectionManagerT.cs.

◆ GetManager() [5/8]

static ConnectionManager Csla.Data.ConnectionManager< C >.GetManager ( string  database,
bool  isDatabaseName,
string  label 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the connection string should be retrieved from the config file. If False, the database parameter is directly used as a connection string.
labelLabel for this connection.
Returns
ConnectionManager object for the name.

Definition at line 97 of file Csla/Data/ConnectionManager.cs.

◆ GetManager() [6/8]

static ConnectionManager< C > Csla.Data.ConnectionManager< C >.GetManager ( string  database,
bool  isDatabaseName,
string  label 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the connection string should be retrieved from the config file. If False, the database parameter is directly used as a connection string.
labelLabel for this connection.
Returns
ConnectionManager object for the name.

Definition at line 98 of file ConnectionManagerT.cs.

◆ GetManager() [7/8]

static ConnectionManager Csla.Data.ConnectionManager< C >.GetManager ( string  database,
string  label 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.
labelLabel for this connection.

Definition at line 58 of file Csla/Data/ConnectionManager.cs.

◆ GetManager() [8/8]

static ConnectionManager< C > Csla.Data.ConnectionManager< C >.GetManager ( string  database,
string  label 
)
static

Gets the ConnectionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.
labelLabel for this connection.

Definition at line 59 of file ConnectionManagerT.cs.

Property Documentation

◆ Connection [1/2]

IDbConnection Csla.Data.ConnectionManager< C >.Connection
get

Dispose object, dereferencing or disposing the connection it is managing.

Definition at line 167 of file Csla/Data/ConnectionManager.cs.

◆ Connection [2/2]

C Csla.Data.ConnectionManager< C >.Connection
get

Gets the open database connection object.

Definition at line 158 of file ConnectionManagerT.cs.

◆ RefCount

int Csla.Data.ConnectionManager< C >.RefCount
get

Gets the current reference count for this object.

Definition at line 181 of file Csla/Data/ConnectionManager.cs.