Beispiel #1
0
        protected void Application_Start()
        {
            //Twilio
            TwilioClient.Init(
                "AC5a90f4c08845d2654bd03e6ae0804777",
                "cb8b72b5dc75f921421b7b90dcbf7646"
                );
            //Telerik Report
            Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
            //AutoMapper
            Mapper.Initialize(cfg => {
                cfg.AddProfile <AutoMapperProfile>();
            });
            //Ioc for MVC
            var container = new Container();

            container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
            ServiceDependecyRegistration.Register(container);
            container.RegisterMvcControllers(Assembly.GetExecutingAssembly());
            container.Verify();
            DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container));

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
Beispiel #2
0
        protected void Application_Start()
        {
            Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(System.Web.Http.GlobalConfiguration.Configuration);
            //AutoMapper
            Mapper.Initialize(cfg => {
                cfg.AddProfile <AutoMapperProfile>();
            });
            //Ioc for MVC
            var container = new Container();

            container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
            ServiceDependecyRegistration.Register(container);
            container.RegisterMvcControllers(Assembly.GetExecutingAssembly());
            container.Verify();
            DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container));

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }