This project is read-only.

LoadModules.Execute

Nov 20, 2009 at 7:35 AM

why not like this:

        public void Execute(IDictionary<string, object> state)
        {

//......
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            foreach (OxiteModuleConfigurationElement module in config.Modules)
            {
                IOxiteModule moduleInstance = modulesLoaded.Load(config, module);

                if (moduleInstance != null)
                {
                    moduleInstance.RegisterWithContainer();
                    moduleInstance.Initialize();
                    moduleInstance.RegisterFilters(filterRegistry);
                    moduleInstance.RegisterModelBinders(modelBinders);
                    moduleInstance.RegisterRoutes(routes);
                    moduleInstance.RegisterCatchAllRoutes(routes); 
                }
            }

            this.container.RegisterInstance(modulesLoaded);
            this.container.RegisterInstance(filterRegistry);
        }

Nov 20, 2009 at 4:18 PM

Routes must be registered in reverse order so other (not system) modules can have their routes matched first.

Nov 21, 2009 at 1:18 AM

The other question:

this.container.RegisterInstance(modulesLoaded);

Why don't take  this line out of "foreach"?

Thanks.