Simple case: I have an interface for logging messages, for example:
public interface ILogger
{
void Log(string message);
}
And maybe three different classes implement this interface.
Now I could write in one place, a line for DI, something like:
kernel.Bind<ILogger>().To<ConsoleLogger>();
My question is how to use this interface in many classes, but not to inject everyone through the constructor. Since we can have so many different interfaces that we want to use, and the declaration in this class constructor can be messy.
source
share