I'm currently building the API for the my Repository interface (I talked about it here). Here is what I have so far:
Couple of things to note, I don't have Delete or Save methods, instead, I use RegisterSave() and RegisterDelete(), both of those make it clearer that a Unit Of Work is in action here. To make it more explicit (and to allow several repositories to use in a single Unit Of Work, I made the Unit Of Work an explicit concept:
A sample code using this framework will look like this:
Looking at the code, I don't know if RegisterSave() gives anything, to tell you the truth.
I'm using the commit only flush mode with NHibernate, which mean that if you are not commit the transaction, it will not be saved to the database. The problem is that then all my writing to the database will be inside a With.Transaction() block, which mostly make the Register***() mote.