I like to bind bellow code with Ninject auto binding. Is it possible to use both mannual & auto binding within a single project? Let;s take bellow manual binding, I want to achieve with auto binding. Please tell me how to achieve this.
kernel.Bind<TestContext>().ToSelf().InRequestScope();
kernel.Bind<IUnitOfWork<TestContext>>().To<UnitOfWork<TestContext>>();
Bellow all interface inherited from base Interface : IRepository< Model >
3 . kernel.Bind<IUserRepository>().To<UserRepository>();
4 . kernel.Bind<IAccountRepository>().To<AccountRepository>();
5 . kernel.Bind<IMessageRepository>().To<MessageRepository>().WithConstructorArgument("apikey", AppSettingsManager.GetSmsApiKey)
Additional
Do I need to write .Exclude<MessageRepository>()
for multiple classes If I required to do it such as
.Exclude<ARepository>()
.Exclude<BRepository>()
.Exclude<CRepository>()
?
and for 1 & 2 is required separate manual binding ? or 1 can be done using BindToSelf()' and
.Configure(b => b.InRequestScope())` ?