コード例 #1
0
        /// <summary>
        /// Retrieve ViewModels from a layout action.
        /// </summary>
        /// <param name="action">An ActionInfo object.</param>
        /// <param name="apis">An ApiList object.</param>
        /// <returns>A list of ViewModels id.</returns>
        public static List <string> GetActionViewModelsId(
            this ActionInfo action,
            ApiList apis)
        {
            var viewModels = new List <string>();

            if (!action.IsValid() ||
                !apis.IsValid())
            {
                return(viewModels);
            }

            var apiAction = action.GetAction();

            if (apiAction.IsValid())
            {
                viewModels = viewModels
                             .Union(apis.GetApiListViewModelsId(apiAction))
                             .ToList();
            }

            return(viewModels);
        }