ShopApp/ShopApp.Web/App_Start/NinjectWebCommon.cs
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
Load your modules or register your services here!
Load your modules or register your services here!
private static void RegisterServices(IKernel kernel)
        {
            kernel.Bind<IRepository<CategoryViewModel, CategoryInputModel>>().To<CategoryRepository>().InRequestScope();
            kernel.Bind<IRepository<ProductViewModel, ProductBaseInputModel>>().To<ProductRepository>().InRequestScope();
            kernel.Bind<IUserService>().To<UserService>().InRequestScope();
            kernel.Bind<IAccountService>().To<AccountService>().InRequestScope();
            kernel.Bind<ICategoryService>().To<CategoryService>().InRequestScope();
            kernel.Bind<IProductService>().To<ProductService>().InRequestScope();
            kernel.Bind<IOrderService>().To<OrderService>().InRequestScope();
            kernel.Bind<IRoleService>().To<RoleService>().InRequestScope();
            kernel.Bind<ILogManager>().To<LogManager>().InSingletonScope();
        }
private static void RegisterServices ( IKernel kernel ) { kernel . Bind < IRepository < CategoryViewModel , CategoryInputModel > > ( ) . To < CategoryRepository > ( ) . InRequestScope ( ) ; kernel . Bind < IRepository < ProductViewModel , ProductBaseInputModel > > ( ) . To < ProductRepository > ( ) . InRequestScope ( ) ; kernel . Bind < IUserService > ( ) . To < UserService > ( ) . InRequestScope ( ) ; kernel . Bind < IAccountService > ( ) . To < AccountService > ( ) . InRequestScope ( ) ; kernel . Bind < ICategoryService > ( ) . To < CategoryService > ( ) . InRequestScope ( ) ; kernel . Bind < IProductService > ( ) . To < ProductService > ( ) . InRequestScope ( ) ; kernel . Bind < IOrderService > ( ) . To < OrderService > ( ) . InRequestScope ( ) ; kernel . Bind < IRoleService > ( ) . To < RoleService > ( ) . InRequestScope ( ) ; kernel . Bind < ILogManager > ( ) . To < LogManager > ( ) . InSingletonScope ( ) ; }
Load your modules or register your services here!
Load your modules or register your services here!
// injecting the repositories // injecting the services // injecting the custom logger
kernel
IKernel
None