A little question regarding Ninject.
I use a WCF 'duplex channel' to communicate with a service. The channel is defined as an interface, lets call it IMyChannel
for simplicity. To instantiate a channel we use DuplexChannelFactory<IMyChannel>
object's CreateChannel()
method.
So far I have manage to bind the factory class with this.
Bind< DuplexChannelFactory< IMyChannel>>().ToMethod(context =>
new DuplexChannelFactory< IMyChannel>(
new MessageEndPoint(),
new NetTcpBinding(),
"net.tcp://localhost:8321")).InSingletonScope();
}
}
However I'm a little unsure how to bind the IMyChannel
interface since I use Ninject to create DuplexChannelFactory<IMyChannel>
so to bind IMyChannel
I do Bind< IMyChannel>().
???