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.ObjectContextManager< C > Class Template Reference

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

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

Public Member Functions

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

Static Public Member Functions

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

Properties

ObjectContext [get]
 Gets the EF object context object. More...
 
int RefCount [get]
 Gets the current reference count for this object. More...
 

Detailed Description

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

Template Parameters
CType of database object context object to use.

This type stores the object 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 :ObjectContext 

Definition at line 35 of file Csla/Data/ObjectContextManager.cs.

Member Function Documentation

◆ Dispose()

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

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

Definition at line 202 of file Csla/Data/ObjectContextManager.cs.

◆ GetManager() [1/4]

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

Gets the ObjectContextManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 49 of file Csla/Data/ObjectContextManager.cs.

◆ GetManager() [2/4]

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

Gets the ObjectContextManager 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 81 of file Csla/Data/ObjectContextManager.cs.

◆ GetManager() [3/4]

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

Gets the ObjectContextManager 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 101 of file Csla/Data/ObjectContextManager.cs.

◆ GetManager() [4/4]

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

Gets the ObjectContextManager object for the specified database.

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

Definition at line 62 of file Csla/Data/ObjectContextManager.cs.

Property Documentation

◆ ObjectContext

C Csla.Data.ObjectContextManager< C >.ObjectContext
get

Gets the EF object context object.

Definition at line 151 of file Csla/Data/ObjectContextManager.cs.

◆ RefCount

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

Gets the current reference count for this object.

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