This project is read-only.

WCF Support

Jun 18, 2012 at 10:22 PM

If would be great if there was a NuGet package for WCF support, something akin to ninject.extensions.wcf.

It looks like it's a pretty straight forward ServiceHost implementation.

Jun 18, 2012 at 10:40 PM
Edited Jun 19, 2012 at 12:24 PM

I wanted yo write about my vision of WCF services on my blog for a long to, but haven't found the time for it. As I see it, there is not really any need for any WCF/DI integration package when doing things 'right'. In my opinion, your WCF service should consist of just a single service class with two methods. One method for executing an arbitrary command, and one method for executing an arbitrary query.

When doing things like this, your WCF service will never need any maintenance and don't need to do things with ServiceHosts for DI integration.

Of course, this isn't possible, since you might already have an existing WCF service. In this scenario, such a package might be beneficial.

Jun 18, 2012 at 11:47 PM

I'd love to see that blog post, it certainly sounds like an interesting way of doing it.

The service I'm currently working on is a WCF REST service using JSON serialization, using the guides on pages like this it ends up being fairly straight forward to implement a reasonably clean api.

When it comes to dependency injection I use constructor injection and when I need to defer instantiation I inject factories. This kind of pattern should work well with the ServiceHost type approach from what I've read.

Sep 23, 2012 at 8:12 PM

There is now a WCF Integration package for the Simple Injector. However, I personally still favor writing a Higly Maintainable WCF Service instead. Fortunately you now have a choice :-)

Marked as answer by dot_NET_Junkie on 11/4/2013 at 2:02 AM