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

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

Inheritance diagram for Csla.Data.EF6.DbContextManager< C >:

Public Member Functions

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

Static Public Member Functions

static DbContextManager< C > GetManager ()
 Gets the ObjectContextManager object for the /// specified database. More...
 
static DbContextManager< C > GetManager (string database)
 Gets the ObjectContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (string database, string label)
 Gets the ObjectContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (string database, DbCompiledModel model)
 Gets the ObjectContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (string database, string label, DbCompiledModel model)
 Gets the ObjectContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (ObjectContext context)
 Gets the ObjectContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (ObjectContext context, string label)
 Gets the ObjectContextManager object for the specified database. More...
 

Properties

DbContext [get]
 Gets the DbContext object. More...
 
int RefCount [get]
 Gets the current reference count for this object. More...
 

Detailed Description

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

Template Parameters
CType of database DbContext 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 :DbContext 

Definition at line 36 of file Csla.Data.EF6/DbContextManager.cs.

Member Function Documentation

◆ Dispose()

void Csla.Data.EF6.DbContextManager< C >.Dispose ( )

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

Definition at line 241 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [1/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< C >.GetManager ( )
static

Gets the ObjectContextManager object for the /// specified database.

Definition at line 47 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [2/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< C >.GetManager ( ObjectContext  context)
static

Gets the ObjectContextManager object for the specified database.

Parameters
contextThe ObjectContext to wrap in DbContext

Definition at line 123 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [3/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< C >.GetManager ( ObjectContext  context,
string  label 
)
static

Gets the ObjectContextManager object for the specified database.

Parameters
contextThe ObjectContext to wrap in DbContext
labelLabel for this context.

Definition at line 136 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [4/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< 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 57 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [5/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< C >.GetManager ( string  database,
DbCompiledModel  model 
)
static

Gets the ObjectContextManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.
modelDatabase compiled model.

Definition at line 79 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [6/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< 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 68 of file Csla.Data.EF6/DbContextManager.cs.

◆ GetManager() [7/7]

static DbContextManager< C > Csla.Data.EF6.DbContextManager< C >.GetManager ( string  database,
string  label,
DbCompiledModel  model 
)
static

Gets the ObjectContextManager object for the specified database.

Parameters
databaseThe database name or connection string.
labelLabel for this context.
modelDatabase Compiled model.
Returns
ContextManager object for the name.

Definition at line 95 of file Csla.Data.EF6/DbContextManager.cs.

Property Documentation

◆ DbContext

C Csla.Data.EF6.DbContextManager< C >.DbContext
get

Gets the DbContext object.

Definition at line 191 of file Csla.Data.EF6/DbContextManager.cs.

◆ RefCount

int Csla.Data.EF6.DbContextManager< C >.RefCount
get

Gets the current reference count for this object.

Definition at line 207 of file Csla.Data.EF6/DbContextManager.cs.