C# Class Unosquare.Labs.EntityFramework.EnterpriseExtensions.BusinessDbContext

Creates a new DbContext with support to run BusinessControllers
Inheritance: DbContext, IBusinessDbContext
Exibir arquivo Open project: unosquare/ef-enterpriseextensions

Public Methods

Method Description
AddController ( IBusinessRulesController controller ) : void

Adds a new BusinessController to the DbContext

ContainsController ( IBusinessRulesController controller ) : bool

Checks if a BusinessController exists

RemoveController ( IBusinessRulesController controller ) : void

Removes a new BusinessController to the DbContext

SaveChanges ( ) : int

Save Changes and run all the business controllers

SaveChangesAsync ( ) : Task

Save Changes Async and run all the business controllers

SaveChangesAsync ( CancellationToken cancellationToken ) : Task

Save Changes Async and run all the business controllers

Protected Methods

Method Description
BusinessDbContext ( ) : System.Collections.Generic

Instances a new DbContext

BusinessDbContext ( DbConnection dbConnection, bool contextOwnsConnection ) : System.Collections.Generic

Instances a new DbContext with a DbConnection

BusinessDbContext ( string connectionName ) : System.Collections.Generic

Instances a new DbContext with a connection name

Private Methods

Method Description
RunBusinessRules ( ) : void

Method Details

AddController() public method

Adds a new BusinessController to the DbContext
public AddController ( IBusinessRulesController controller ) : void
controller IBusinessRulesController
return void

BusinessDbContext() protected method

Instances a new DbContext
protected BusinessDbContext ( ) : System.Collections.Generic
return System.Collections.Generic

BusinessDbContext() protected method

Instances a new DbContext with a DbConnection
protected BusinessDbContext ( DbConnection dbConnection, bool contextOwnsConnection ) : System.Collections.Generic
dbConnection System.Data.Common.DbConnection
contextOwnsConnection bool
return System.Collections.Generic

BusinessDbContext() protected method

Instances a new DbContext with a connection name
protected BusinessDbContext ( string connectionName ) : System.Collections.Generic
connectionName string
return System.Collections.Generic

ContainsController() public method

Checks if a BusinessController exists
public ContainsController ( IBusinessRulesController controller ) : bool
controller IBusinessRulesController
return bool

RemoveController() public method

Removes a new BusinessController to the DbContext
public RemoveController ( IBusinessRulesController controller ) : void
controller IBusinessRulesController
return void

SaveChanges() public method

Save Changes and run all the business controllers
public SaveChanges ( ) : int
return int

SaveChangesAsync() public method

Save Changes Async and run all the business controllers
public SaveChangesAsync ( ) : Task
return Task

SaveChangesAsync() public method

Save Changes Async and run all the business controllers
public SaveChangesAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task