예제 #1
0
        private static NavigationLink MappingLinkItems(MenuItem item)
        {
            var linkItem = new NavigationLink();

            linkItem.Id             = item.Id;
            linkItem.ParentId       = item.ParentId;
            linkItem.LinkText       = item.LinkText;
            linkItem.ActionName     = item.ActionName;
            linkItem.ControllerName = item.ControllerName;
            linkItem.Order          = item.Order;
            return(linkItem);
        }
예제 #2
0
        private static IEnumerable <NavigationLink> GetChildMenu(IEnumerable <MenuItem> data, int id)
        {
            var child = data.Where(n => id == n.ParentId)
                        .OrderBy(n => n.Order).ToList();

            var childMenu = new List <NavigationLink>();

            foreach (var childItem in child)
            {
                NavigationLink childLinkItem = MappingLinkItems(childItem);
                childMenu.Add(childLinkItem);
            }
            return(childMenu);
        }