currently I have some implementation of transactional UoW (TransactionScope
+ NH) working as WebApi 2 action filter but I'm preparing to do the same on WCF service level.
I need some requirements on properly implemented Uow in WCF:
it needs to be transparent, this means that that i don't want to injected
IUnitOfWork
implementation anywhere except logic that starts uow and commits / rollbacks uow.Like in webapi uow management has to be done before WCF service method call and after it was called and probably react to exception during call
What's the best way to prepare something like action filter in WCF infrastructure?
my WCF service logic expects only injections of
IRepositories
(which internally haveISession
) and no uow stuff. This way my code will be clean. Architecture assumes that client (MVC app) starts distributed transaction and this transaction flows to WCF service which also enlists in current opened transaction.
Are there any caveats?