2

Does anyone have a complete and working DI sample for WCF?

Every sample I find just gets me more confused. Does anyone know of a complete and working standalone simple sample that works with the built in stuff?

Maybe once I get a handle of the built in stuff, I can move on to different DI frameworks such as StructureMap or Unity with WCF.

My MVC project is currently using Unity for all its DI.

makerofthings7
  • 60,103
  • 53
  • 215
  • 448
  • See article [hosting-mock-as-wcf-service](http://bronumski.blogspot.com.au/2011/09/hosting-mock-as-wcf-service.html) and answer http://stackoverflow.com/a/10306934/52277 – Michael Freidgeim Jul 05 '13 at 23:41

5 Answers5

2

I recommend this one. I have already used it and it is fully working.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
1

The code download for my book Dependency Injection in .NET contains a full, working example.

However, most of what you'll need to know is explained in this answer: Injecting data to a WCF service

Community
  • 1
  • 1
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
0

There is a fully working downloadable sample here on Codeplex. It uses the Unity.WCF NuGet package, so it's really the kind of slam dunk example you are looking for.

tjp69
  • 1,068
  • 9
  • 13
0

This one is the most straightforward one I've found.

Paul
  • 35,689
  • 11
  • 93
  • 122
  • 1
    What is the proper way to set up the Unity container as mentioned in the Todo? What should I do after `new UnityContainer();`? – makerofthings7 Mar 10 '11 at 05:17