Пример #1
0
        public override bool OnStart()
        {
            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
            RoleEnvironment.Changing += RoleEnvironmentChanging;
            RoleEnvironment.Changed  += RoleEnvironmentChanged;

            using (var container = new UnityContainer())
            {
                ContainerBootstraper.RegisterTypes(container, true);

                container.Resolve <ISurveyStore>().Initialize();
                container.Resolve <ISurveyAnswerStore>().Initialize();
                container.Resolve <ISurveyAnswersSummaryStore>().Initialize();
                container.Resolve <ISurveyTransferStore>().Initialize();

                var tenantStore = container.Resolve <ITenantStore>();
                tenantStore.Initialize();

                // Set Adatum's logo
                SetLogo("adatum", tenantStore, TenantInitLogo.adatum_logo);

                // Set Fabrikam's logo
                SetLogo("fabrikam", tenantStore, TenantInitLogo.fabrikam_logo);

                return(base.OnStart());
            }
        }
        protected void Application_Start()
        {
            var container = new UnityContainer();

            ContainerBootstraper.RegisterTypes(container, false);

            RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            AreaRegistration.RegisterAllAreas();
            AppRoutes.RegisterRoutes(RouteTable.Routes);
            AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
        }
Пример #3
0
        protected void Application_Start()
        {
            var container = new UnityContainer();

            ContainerBootstraper.RegisterTypes(container, false);
            ControllerBuilder.Current.SetControllerFactory(new UnityControllerFactory(container));

            RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            AreaRegistration.RegisterAllAreas();
            AppRoutes.RegisterRoutes(RouteTable.Routes);

            FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated;
        }
        public override bool OnStart()
        {
            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
            RoleEnvironment.Changing += RoleEnvironmentChanging;
            RoleEnvironment.Changed  += RoleEnvironmentChanged;

            StartDiagnosticMonitor();

            using (var container = new UnityContainer())
            {
                ContainerBootstraper.RegisterTypes(container, true);

                container.Resolve <ISurveyStore>().Initialize();
                container.Resolve <ISurveyAnswerStore>().Initialize();
                container.Resolve <ISurveyAnswersSummaryStore>().Initialize();
                container.Resolve <ISurveyTransferStore>().Initialize();

                var tenantStore = container.Resolve <ITenantStore>();
                tenantStore.Initialize();

                // set adatum's logo
                if (string.IsNullOrWhiteSpace(tenantStore.GetTenant("adatum").Logo))
                {
                    using (var stream = new MemoryStream())
                    {
                        TenantInitLogo.adatum_logo.Save(stream, ImageFormat.Png);
                        tenantStore.UploadLogo("adatum", stream.ToArray());
                    }
                }

                // set fabrikam's logo
                if (string.IsNullOrWhiteSpace(tenantStore.GetTenant("fabrikam").Logo))
                {
                    using (var stream = new MemoryStream())
                    {
                        TenantInitLogo.fabrikam_logo.Save(stream, ImageFormat.Png);
                        tenantStore.UploadLogo("fabrikam", stream.ToArray());
                    }
                }
            }

            return(base.OnStart());
        }
Пример #5
0
        public override bool OnStart()
        {
            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
            RoleEnvironment.Changing += RoleEnvironmentChanging;
            RoleEnvironment.Changed += RoleEnvironmentChanged;
            
            using (var container = new UnityContainer())
            {
                ContainerBootstraper.RegisterTypes(container, true);

                container.Resolve<ISurveyStore>().InitializeAsync().Wait();
                container.Resolve<ISurveyAnswerStore>().InitializeAsync().Wait();
                container.Resolve<ISurveyAnswersSummaryStore>().InitializeAsync().Wait();
                container.Resolve<ISurveyTransferStore>().InitializeAsync().Wait();

                var tenantStore = container.Resolve<ITenantStore>();
                tenantStore.InitializeAsync().Wait();
            }

            return base.OnStart();
            }