C# Класс Habanero.BO.TransactionCommitterMultiSource

An implementation of ITransactionCommitter used as an aggregate transaction committer. It stores a dictionary of IDataAccessor - one for each type, as well as a default. If the business object added is linked to a particular DataAccessor it will be added to that one, otherwise it will be added to the default. Note that only one underlying DataAccessor will be allowed to be used. If you add business objects whose types are linked to different DataAccessors you will get an error. This can be used when you have some objects that are persisted to one database and others to another. See DataAccessorMultiSource
Наследование: ITransactionCommitter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddBusinessObject ( IBusinessObject businessObject ) : void

Add an object of type business object to the transaction. The DBTransactionCommiter wraps this Business Object in the appropriate Transactional Business Object

AddTransaction ( ITransactional transaction ) : void

This method adds an ITransactional to the list of transactions.

CommitTransaction ( ) : List

Commit the transactions to the datasource e.g. the database, file, memory DB

TransactionCommitterMultiSource ( IDataAccessor defaultDataAccessor, IDataAccessor>.Dictionary dataAccessors ) : System

Constructor

Приватные методы

Метод Описание
GetDataAccessorForType ( Type type ) : IDataAccessor

Описание методов

AddBusinessObject() публичный Метод

Add an object of type business object to the transaction. The DBTransactionCommiter wraps this Business Object in the appropriate Transactional Business Object
public AddBusinessObject ( IBusinessObject businessObject ) : void
businessObject IBusinessObject
Результат void

AddTransaction() публичный Метод

This method adds an ITransactional to the list of transactions.
public AddTransaction ( ITransactional transaction ) : void
transaction ITransactional The transaction to add to the .
Результат void

CommitTransaction() публичный Метод

Commit the transactions to the datasource e.g. the database, file, memory DB
public CommitTransaction ( ) : List
Результат List

TransactionCommitterMultiSource() публичный Метод

Constructor
public TransactionCommitterMultiSource ( IDataAccessor defaultDataAccessor, IDataAccessor>.Dictionary dataAccessors ) : System
defaultDataAccessor IDataAccessor The default , used for all objects that don't have an alternate DataAccessor specified
dataAccessors IDataAccessor>.Dictionary The alternate DataAccessors - each type can be linked to one data accessor (and more than one type to the same one.
Результат System