コード例 #1
0
        public static void RegisterServices(IKernel kernel)
        {
            var passwordHelper = new PasswordHelper();
            passwordHelper.Initialize();

            var repository = new Repository(
                new ProductionSessionFactoryContainer(
                    ConfigurationManager.ConnectionStrings["PeerLearn"].
                        ConnectionString).CreateSessionFactory());

            kernel.Bind<IRepository>().ToConstant(repository);
            kernel.Bind<IEventService>().To<EventService>();
            kernel.Bind<IFormsAuthenticationService>().To<FormsAuthenticationService>();
            kernel.Bind<PasswordHelper>().ToConstant(passwordHelper);
        }
コード例 #2
0
 public AccountController(IRepository repository, PasswordHelper crypto, IFormsAuthenticationService authService)
 {
     _repository = repository;
     _passwordCrypto = crypto;
     _authentication = authService;
 }