This is part 1. The sourcecode is here.
This article is based on this tutorial.
So I created an IStoryTeller interface, with one method that returns a string. GoodMorning.
Very sophisticated, no?
Next, I created 2 classes that implement the IStoryTeller interface. A French and a Dutch. I'm pretty sure you know where this is going:
Now I have to create an installer for the StoryTeller. Here is where I tell Castle Windsor which StoryTeller to implement:
Now I can create the controller and add the IStoryTeller to the constructor:
And now if I change the Installer and inject the FrenchStoryTeller I get:
So this is how easy this is.
2 thoughts on “Castle Windsor ASP.NET MVC 3 Baby Example part 2”