I was searching the net up and down and I didn't manage to find a suitable design for my application.
I am looking for Repository+UnitOfWork pattern that will manage connections and dispose them automatically when done.
I need to support both web application where each request will have its own UnitOfWork and windows application where each thread will have its own UnitOfWork. I need the patters to dispose automatically the UnitOfWork whrn request/thread is done. I also would like to support rolback in case of exception.
Right now I use StructureMap so I don't care to continue use it in the suggest answers.
The reason I need Repository pattern is to achieve all the abilities I need to all my entities. The reason I need UnitOfWork is to allow changes in more then one entity.
I will really appriciate any help.
Thanks.