简体   繁体   中英

Is it possible to use Rhino.Commons.HttpModules.UnitOfWorkApplication in ASP.NET 3.5 (not MVC)?

I tried to find tutorials/articles on using UnitOfWorkApplication in ASP.NET (not MVC). But all information I can find is about how to use it in ASP.NET MVC.

Does it mean that it is not possible to use Rhino.Commons.HttpModules.UnitOfWorkApplication in our old webform applications?

I run into the problem that I am using repository inherited from Rhino.Commons.NHRepository in ASP.NET pages. It requires to call UnitOfWork.Start() before calling functions in the repository. I'm quite lost in figuring out how to hook that into ASP.NET.

Yes, it works with regular ASP.NET. Just make your GlobalApplication inherit from UnitOfWorkApplication. UnitOfWork.Start() is automatically executed when the request starts ( source code ).

For reference, check the wiki page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM