I have the following code:
class Controller
{
public Controller(Listener audioListener,
Listener videoListener)
{}
}
class Listener
{
public Listener(int port)
{
Console.WriteLine(port);
}
}
Now I need that the Listener
is resolved one time with audioPort
and the other with videoPort
.
var audioPort = 1330;
var videoPort = 1331;
var controller = kernel.Get<Controller>(); // should print 1330 and 1331
So far I've done this when binding with WithConstructorArgument
that takes a callback. I was wondering if I can set the callback when actually resolving the type?