Example #1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     DependencyConfig.Configure();
 }
Example #2
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            DependencyConfig.Configure(new ContainerBuilder());

            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RequiredIfAttribute), typeof(RequiredIfValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AssertThatAttribute), typeof(AssertThatValidator));

            // override standard error messages
            ClientDataTypeModelValidatorProvider.ResourceClassKey = "DefaultResources";
            DefaultModelBinder.ResourceClassKey = "DefaultResources";


            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(RequiredAttribute), typeof(MyRequiredAttributeAdapter));

            // init log4net
            log4net.Config.XmlConfigurator.Configure();

            MvcHandler.DisableMvcResponseHeader = true;

            Store = new EmbeddableDocumentStore {
                ConnectionStringName = "RavenDB"
            };
            Store.Initialize();
        }
Example #3
0
 protected void Application_Start()
 {
     DependencyConfig.Configure();
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
Example #4
0
        /// <summary>
        /// Register all components
        /// </summary>
        ///
        public static void RegisterComponents()
        {
            var container = new UnityContainer();

            DependencyConfig.Configure(container);

            GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
        }
Example #5
0
        public static void RegisterComponents()
        {
            var container = new UnityContainer();

            DependencyConfig.Configure(container);

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
Example #6
0
        public void Configuration(IAppBuilder app)
        {
            // Use Autofac as an Owin middleware
            var container = DependencyConfig.Configure(new ContainerBuilder());

            app.UseAutofacMiddleware(container);
            app.UseAutofacMvc();  // requires Autofac.Mvc5.Owin nuget package installed

            app.UseGeonorgeAuthentication();
        }
Example #7
0
        public void Configuration(IAppBuilder app)
        {
            DependencyConfig.Configure();

            app.UseCookieAuthentication(new Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath          = new PathString("/Account/Login"),
                CookieName         = "dsauth"
            });
            app.MapSignalR();
        }
Example #8
0
        protected void Application_Start()
        {
            MvcHandler.DisableMvcResponseHeader = true;

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DependencyConfig.Configure(new ContainerBuilder());

            AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;

            log4net.Config.XmlConfigurator.Configure();
        }
Example #9
0
        public void Configuration(IAppBuilder app)
        {
            DependencyConfig.Configure(app);

            //JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();


            //app.UseIdentitiyServerSelfContainedToken(new SelfContainedTokenValidationOptions
            //{
            //    IssuerName = "https://identity.arkitektum.no",
            //    //SigningCertificate = X509.LocalMachine.TrustedPeople.SubjectDistinguishedName.Find("CN=identity.arkitektum.no", false).First()
            //    SigningCertificate = Certificate.Get()
            //});

            //app.UseIdentitiyServerReferenceToken(new ReferenceTokenValidationOptions
            //{
            //    TokenValidationEndpoint = "https://identity.arkitektum.no/core/connect/accessTokenValidation"
            //});
        }
Example #10
0
        protected override void RegisterApplicationComponents(IApplicationBuilder app, IKernel kernel)
        {
            app.UseSignalR(routes =>
            {
                routes.MapHub <TasksHub>("/tasks");
            });

            _applicationBuilder = app;

            kernel.Bind <IHubContext <TasksHub> >().ToMethod(x => GetHubContext <TasksHub>());
            kernel.Bind <IHostedService>().To <TasksMessagingService>();
            DependencyConfig.Configure(kernel);
            DependencyResolver.SetResolver(kernel);

            var tuple   = kernel.Get <Tuple <IContextStorage, IConnectionContext> >();
            var storage = tuple.Item1;
            var context = tuple.Item2;

            using (context.Scope())
            {
                storage.Get().Database.Migrate();
            }
        }
 protected void Application_Start()
 {
     DependencyConfig.Configure();
     GlobalConfiguration.Configure(WebApiConfig.Register);
 }