private static IKernel CreateNinjectKernel() { var kernel = new StandardKernel(); kernel.Load(Assembly.GetExecutingAssembly()); kernel.BindSharpRepository(); return(kernel); }
private static StandardKernel CreateKernel() { var kernel = new StandardKernel(); kernel.BindSharpRepository(); RepositoryDependencyResolver.SetDependencyResolver(new NinjectDependencyResolver(kernel)); var connectionString = ConfigurationManager.ConnectionStrings["SolutionTemplate"].ConnectionString; kernel.Bind <DbContext>() .To <SolutionTemplateContext>() .InRequestScope() .WithConstructorArgument("connectionString", connectionString); kernel.Bind <IWidgetService>().To <WidgetService>(); return(kernel); }