Fork me on GitHub

Setup of the scoping event broker

The usage of the scoping event broker is astonishingly simple. Basically it is only two lines of code.

Everything is setup now. But in order to get the scoping mechanism working you have to explicitely tell the scoping event broker when a scopes starts, ends or is rolled back. This can be done either with the provided unit of work scope or the transaction scope.

Basic usage with the unit of work

For more and detailed information about the unit of work approach read here.

Basic usage with the transaction scope

For more and detailed information about the transaction scope approach read here.

Recommendations

Whenever your technology of choice (i.ex. Entity Framework or NHibernate) supports TransactionScope we suggest that you use the transaction scope approach because this doesn't actually expose your code to the scoping event broker whenever you need scoping.