Could anyone tell me?
Could anyone tell me?
You can use Mudules as explained in the documentation:
Basically you create a Module in a DLL, like this:
public class WarriorModule : NinjectModule
{
public override void Load()
{
Bind<IWeapon>().To<Sword>();
Bind<Samurai>().ToSelf().InSingletonScope();
}
}
And calls in both projects (MVC and Web Api):
IKernel kernel = new StandardKernel(new WarriorModule());
IDependency dependency = kernel.Get<IDependency>();