Пример #1
0
        public ControllerApiDescriptionModel AddController(ControllerApiDescriptionModel controller)
        {
            if (this.Controllers.ContainsKey(controller.Name))
            {
                throw new AbpException($"There is already a controller with name: {controller.Name} in module: {this.Name}");
            }

            return(this.Controllers[controller.Name] = controller);
        }
Пример #2
0
        public ControllerApiDescriptionModel CreateSubModel(string[] actions)
        {
            var subModel = new ControllerApiDescriptionModel(this.Name);

            foreach (var action in this.Actions.Values)
            {
                if (actions == null || actions.Contains(action.Name))
                {
                    subModel.AddAction(action);
                }
            }

            return(subModel);
        }