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

Provides an automated way to reuse LINQ data context objects within the context of a single data portal operation. More...

Inheritance diagram for Csla.Data.ContextManager< C >:
Csla.Core.IUseApplicationContext

Public Member Functions

ContextManager< C > GetManager (string database)
 Gets the ContextManager object for the specified database. More...
 
ContextManager< C > GetManager (string database, string label)
 Gets the ContextManager object for the specified database. More...
 
ContextManager< C > GetManager (string database, bool isDatabaseName)
 Gets the ContextManager object for the specified database. More...
 
ContextManager< C > GetManager (string database, bool isDatabaseName, string label)
 Gets the ContextManager object for the specified database. More...
 
void Dispose ()
 Dispose object, dereferencing or disposing the context it is managing. More...
 

Properties

DataContext [get]
 Gets the LINQ data context object. More...
 
int RefCount [get]
 Gets the current reference count for this object. More...
 
- Properties inherited from Csla.Core.IUseApplicationContext
ApplicationContext ApplicationContext [getset]
 Gets or sets the current ApplicationContext object. More...
 

Detailed Description

Provides an automated way to reuse LINQ data context objects within the context of a single data portal operation.

Template Parameters
CType of database LINQ data context objects object to use.

This type stores the LINQ data context object in Csla.ApplicationContext.LocalContext and uses reference counting through IDisposable to keep the data context object open for reuse by child objects, and to automatically dispose the object when the last consumer has called Dispose."

Type Constraints
C :DataContext 

Definition at line 36 of file ContextManager.cs.

Member Function Documentation

◆ Dispose()

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

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

Definition at line 205 of file ContextManager.cs.

◆ GetManager() [1/4]

ContextManager< C > Csla.Data.ContextManager< C >.GetManager ( string  database)

Gets the ContextManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 54 of file ContextManager.cs.

◆ GetManager() [2/4]

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

Gets the ContextManager 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
ContextManager object for the name.

Definition at line 86 of file ContextManager.cs.

◆ GetManager() [3/4]

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

Gets the ContextManager 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 context.
Returns
ContextManager object for the name.

Definition at line 106 of file ContextManager.cs.

◆ GetManager() [4/4]

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

Gets the ContextManager object for the specified database.

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

Definition at line 67 of file ContextManager.cs.

Property Documentation

◆ DataContext

C Csla.Data.ContextManager< C >.DataContext
get

Gets the LINQ data context object.

Definition at line 155 of file ContextManager.cs.

◆ RefCount

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

Gets the current reference count for this object.

Definition at line 171 of file ContextManager.cs.