I have my service layer serving as a facade over my domain model layer to orchestrate calls to domain objects. I wrote a custome instance provider for my WCF services to harness MEF for instance creation. Now I need to apply PIAB for auditing and logging. How could I do it?
Share
Jimmy Tonner has written a nice blog about mixing MEF and PIAB (visit http://blogs.msdn.com/b/jimmytr/archive/2010/06/22/mixing-mef-and-piab.aspx). It inspired my solution to applying PIAB to a MEFied WCF service.
Idea is simple: use MEF to manage all your service composition first. Then in the custom instance provider, apply PolicyInjection.Wrap after locating the service instance by MEF container. Below is the code sample:
Service:
Custom instance provider: