Hej, mam wątpliwość czy dobrze to robię. Mam jakieś serwisy i repozytoria. Pytanie jest w komentarzu
W taki sposób binduję
class AppInfrastructureNinjectModule : NinjectModule
{
public override void Load()
{
Bind<IMessageService>().To<MessageService>();
Bind<IMessageRepository>().To<MessageRepository>();
Bind<ISerwerTcpService>().To<SerwerTcpService>();
}
}
a w tem sposób używam
private static async Task MainAsync(string[] args)
{
IKernel kernel = new StandardKernel(new AppInfrastructureNinjectModule());
MessageService _messageService = kernel.Get<MessageService>(); // tutaj nie wiem czy ma być tak jak jest czy Get<IMessageService> ???
await _messageService.GetReport();
}