How to use Rhino Commons in ASP.Net

time to read 2 min | 215 words

In the web space, the Unit of Work pattern is usually mapped to a unit of work per web request. This translate very easily to an http module, which you can find here. It configures the container automatically from a file named (by defauly) "windsor.config", and starts / dispose unit of works as part of the http pipeline.

Basically, this means that you never need to worry about this.

The configuration is simply:

<

httpModules>
     <add name="UnitOfWorkModule"
               type="Rhino.Commons.HttpModules.UnitOfWorkModule"/>
</
httpModules>

 Important note: currently, I do not allow nesting of unit of works, don't enter Unit Of Work explicitly if you use this http module.