Example #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ParbadConfig.Configure();
        }
Example #2
0
        public void ConfigureServices(ContainerBuilder containerBuilder)
        {
            // Default MVC Configurations
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Register MVC controllers using Autofac
            containerBuilder.RegisterControllers(typeof(HomeController).Assembly);

            // Parbad configuration
            var parbadBuilder = ParbadConfig.Configure();

            // Register Parbad using Autofac.
            containerBuilder.Populate(parbadBuilder.Services);
        }
Example #3
0
        public void ConfigureServices(ContainerBuilder containerBuilder)
        {
            // Default MVC Configurations
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);


            // Register MVC controllers using Autofac
            containerBuilder.RegisterControllers(typeof(HomeController).Assembly);
            // Register a service that gets the Mellat gateway settings from database.
            // This service is added to Parbad inside ParbadConfig.Configure() method.
            containerBuilder.RegisterType <MySettingsService>().As <IMySettingsService>().InstancePerLifetimeScope();


            // Parbad configuration
            var parbadBuilder = ParbadConfig.Configure();

            // Register Parbad using Autofac.
            containerBuilder.Populate(parbadBuilder.Services);
        }