dependency injection not using the constructor

Jun 3, 2010 at 1:25 PM

up until now i was using injection only within the constructor, like so:

protected readonly ILogger theLogger;

public MyClass(ILogger logger)


theLogger = logger;


is there any other way of injecting? without using the constructor?

Jun 3, 2010 at 6:16 PM

You can inject properties or use methods. This is all explained in the documentation and the hands-on labs.