Exemplo n.º 1
0
        private static AreaInfo GetAreaInfo(IList <ActionInfoGroup> urlList, string a)
        {
            var url_list_byArea   = urlList.Where(x => x.Area == a);
            var groupByController = url_list_byArea.GroupBy(x => x.Controller);


            List <ControllerInfo> ciList = new List <ControllerInfo>();

            foreach (var g in groupByController)
            {
                ciList.Add(new ControllerInfo(g.ToArray(), g.Key));
            }

            var ai = new AreaInfo(ciList, a);

            return(ai);
        }
Exemplo n.º 2
0
        private static List <AreaInfo> GetAreaInfoList(IList <Type> types_contoller /*Assembly asp_net*/, ModelInfo modelInfo, ConfigJS.JSNamespace JSNamespace)
        {
            List <AreaInfo> aiList = new List <AreaInfo>();

            IList <ActionInfoGroup> urlList = ExtractUrlFromAspNetMvcApplication(types_contoller /*asp_net*/, JSNamespace, modelInfo);

            List <string> areas = urlList.Where(x => string.IsNullOrWhiteSpace(x.Area) == false).Select(x => x.Area).Distinct().ToList();

            foreach (var a in areas)
            {
                var ai = GetAreaInfo(urlList, a);
                aiList.Add(ai);
            }

            AreaInfo no_area_info = GetAreaInfo(urlList, "");

            aiList.Add(no_area_info);

            return(aiList);
        }