1

The idea is to use DI container on my service contract implementation to instantiate my Business and Data classes.

The reason I need to do it this way, is that I have one service contract that deals with different client requests. Each client request corresponds to different Business class

Hetal
  • 65
  • 7

1 Answers1

0

That sounds like a good idea. Implementing custom ServiceHostFactory, ServiceHost and IInstanceProvider does the trick.

Community
  • 1
  • 1
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
  • Forgot to mention the services will be hosted on IIS. Is it still possible to use your suggestion ass is? – Hetal Mar 20 '10 at 15:09
  • Yes, follow the link and read all about it. The key is to register the custom ServiceHostFactory in you .svc file. – Mark Seemann Mar 20 '10 at 15:38