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.EntityFrameworkCore.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.EntityFrameworkCore.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 DbContextManager object for the /// specified database. More...
 
static DbContextManager< C > GetManager (string database)
 Gets the DbContextManager object for the specified database. More...
 
static DbContextManager< C > GetManager (string database, string label)
 Gets the DbContextManager object for the specified database. More...
 

Protected Member Functions

virtual void Dispose (bool p)
 Dispose object, dereferencing or disposing the context it is managing. 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 33 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

Member Function Documentation

◆ Dispose() [1/2]

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

Definition at line 152 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

◆ Dispose() [2/2]

virtual void Csla.Data.EntityFrameworkCore.DbContextManager< C >.Dispose ( bool  p)
protectedvirtual

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

Definition at line 163 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

◆ GetManager() [1/3]

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

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

Definition at line 44 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

◆ GetManager() [2/3]

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

Gets the DbContextManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 54 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

◆ GetManager() [3/3]

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

Gets the DbContextManager object for the specified database.

Parameters
databaseThe database name or connection string.
labelLabel for this context.


Returns
ContextManager object for the name.

Definition at line 68 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

Property Documentation

◆ DbContext

Gets the DbContext object.

Definition at line 113 of file Csla.Data.EFCore.Shared/DbContextManager.cs.

◆ RefCount

Gets the current reference count for this object.

Definition at line 124 of file Csla.Data.EFCore.Shared/DbContextManager.cs.