Unit of Work in WCF

336 views Asked by At

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:

  1. 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.

  2. 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?

  3. my WCF service logic expects only injections of IRepositories (which internally have ISession) 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?

0

There are 0 answers