Пример #1
0
        public ModuleApiDescriptionModel AddModule(ModuleApiDescriptionModel module)
        {
            if (Modules.ContainsKey(module.Name))
            {
                throw new Exception("There is already a module with same name: " + module.Name);
            }

            return(Modules[module.Name] = module);
        }
Пример #2
0
        public ModuleApiDescriptionModel GetOrAddModule(string name)
        {
            ModuleApiDescriptionModel obj;

            if (Modules.TryGetValue(name, out obj))
            {
                return(obj);
            }
            return(Modules[name] = new ModuleApiDescriptionModel(name));
        }
        public ModuleApiDescriptionModel CreateSubModel(string[] controllers, string[] actions)
        {
            var subModel = new ModuleApiDescriptionModel(Name);

            foreach (var controller in Controllers.Values)
            {
                if (controllers == null || controllers.Contains(controller.Name))
                {
                    subModel.AddController(controller.CreateSubModel(actions));
                }
            }

            return(subModel);
        }