Beispiel #1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     log4net.Config.XmlConfigurator.Configure();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     StructuremapMvc.Start();
 }
Beispiel #2
0
 protected void Application_Start()
 {
     StructuremapMvc.Start();
     AreaRegistration.RegisterAllAreas();
     WebApiConfig.Register(GlobalConfiguration.Configuration);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     AuthConfig.RegisterAuth();
 }
Beispiel #3
0
 void Application_Start(object sender, EventArgs e)
 {
     // Code that runs on application startup
     AreaRegistration.RegisterAllAreas();
     StructuremapMvc.Start();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     AutoMapConfig.ConfigureAutoMapper();
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
Beispiel #4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            AutoMapperBootstrapper.Initialize();

            StructuremapMvc.Start();
            ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory(IoC.Container));
        }
Beispiel #5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var container = StructuremapMvc.Start();

            Mapper.Initialize(cfg => cfg.AddProfile <AutoMapperProfile>());
            FluentValidationModelValidatorProvider.Configure(provider =>
            {
                provider.ValidatorFactory = new StructureMapValidatorFactory(container);
            });
        }
Beispiel #6
0
        /// <summary>
        /// Starts the application
        /// </summary>
        protected void Application_Start()
        {
            ApplicationContext.AppConfigure();
            StructuremapMvc.Start();
            AutoMapperInit.CreateMappings();

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            IoCFilterProvider <IIoCFilter> .ApplyToAllFilters();

            ObjectFactory.GetInstance <ITestService>();
        }
Beispiel #7
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();

            StructuremapMvc.Start();

            CustomGlobalConfig.Customize(GlobalConfiguration.Configuration);

            Database.SetInitializer(new DropCreateDatabaseIfModelChanges <MainContext>());
        }
        protected void Application_Start()
        {
            // This prevents mvc from searching for .aspx pages in a razor based project by removing the engine. Performance?
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

            MvcHandler.DisableMvcResponseHeader = true; // Security?

            StructuremapMvc.Start();                    // IoC Setup.
            AutoMapperConfig.Configure();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
Beispiel #9
0
        public static void GenerarSnapShotDB(TestContext testContext)
        {
            Database.SetInitializer(new ContextInitializer());
            Database.SetInitializer <DbContextBase>(null);
            PersistenceConfigurator.Configure("SIGCOMT", typeof(Usuario).Assembly, typeof(ConnectionFactory).Assembly);

            StructuremapMvc.Start();

            var contextDB = new DbContextBase();

            contextDB.Database.ExecuteSqlCommand(TransactionalBehavior.DoNotEnsureTransaction, @"
                IF DB_ID('TemplateDB_Snap') IS NOT NULL 
                    DROP DATABASE TemplateDB_Snap;

                CREATE DATABASE TemplateDB_Snap ON
                    ( NAME = TemplateDB, FILENAME = 'D:\Temp\TemplateDB_Snapshot.ss' )
                 AS SNAPSHOT OF TemplateDB;
            ");
        }
        public AccountControllerTest()
        {
            var dataSession = DataHelper.Session(
                new User()
            {
                ID = 1, Username = "******", Email = "*****@*****.**", Password = MvcApp.Services.Security.PasswordHash.CreateHash("test")
            }
                );

            dataSession.AddSet(new UserForgotPassword()
            {
                Code = "2s86khVAgN", UserID = 1
            });

            _controller = new AccountController(dataSession, new AuthenticationHelper());

            StructuremapMvc.Start();
            MvcApp.Mappings.AutoMapperConfiguration.Setup();
        }
Beispiel #11
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            Database.SetInitializer(new ContextInitializer());
            Database.SetInitializer <DbContextBase>(null);

            PersistenceConfigurator.Configure("DefaultConnection", typeof(Usuario).Assembly, typeof(ConnectionFactory).Assembly);
            StructuremapMvc.Start();


            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            AutoMapperConfiguration.Configure();

            XmlConfigurator.Configure();

            ModelMetadataProviders.Current = new ConventionalModelMetadataProvider(true, typeof(Master));
        }
 public static void SetUp(TestContext context)
 {
     StructuremapMvc.Start();
 }
 public VotarControllerTest()
 {
     StructuremapMvc.Start();
 }
 /// <summary>
 ///  Cria o servico restaurante
 /// </summary>
 /// <returns></returns>
 public IRestauranteServices GetRestauranteService()
 {
     StructuremapMvc.Start();
     return(StructuremapMvc.StructureMapDependencyScope.Container.GetInstance <IRestauranteServices>());
 }
Beispiel #15
0
 /// <summary>
 ///  Cria o servico usuário
 /// </summary>
 /// <returns></returns>
 public IUsuarioServices GetUsuarioService()
 {
     StructuremapMvc.Start();
     return(StructuremapMvc.StructureMapDependencyScope.Container.GetInstance <IUsuarioServices>());
 }