Example #1
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     NhibernateSetup.Init();
     Mapper.Initialize(cfg => cfg.AddProfiles(typeof(QuestaoMapper).Assembly));
     log4net.Config.XmlConfigurator.Configure();
 }
Example #2
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            NhibernateSetup.Init();

            //Migração inicial
            var caminhoBanco = new AppSettingsReader().GetValue("Banco.Arquivo", typeof(string)).ToString();

            Migrador.Configuracao.RealizarUpgrade(caminhoBanco);

            //Configurando injeção de dependência
            var container = Configuracoes.SimpleInjector.ObterContainer();

            container.RegisterWebApiControllers(GlobalConfiguration.Configuration);
            container.Verify();

            GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);
        }