Exemple #1
0
        public CommandInfo(TCommand command, IEnumerable <CommandFilterAttribute> globalFilters)
        {
            Command = command;

            var allFilters = new List <CommandFilterAttribute>();

            if (globalFilters != null && globalFilters.Any())
            {
                allFilters.AddRange(globalFilters);
            }

            var filters = AppServer.GetCommandFilterAttributes(command.GetType());

            if (filters.Any())
            {
                allFilters.AddRange(filters);
            }

            if (allFilters.Any())
            {
                Filters = allFilters.OrderBy(f => f.Order).ToArray();
            }
        }