コード例 #1
0
        public void BuildMenuLinks()
        {
            var menuItems = Items.ToList();

            foreach (var item in menuItems)
            {
                if (item.Url.IsNotNullOrEmpty() && _linkBuilder.UrlIsValid(item.Url))
                {
                    item.FullActionUrl = item.Url;
                }
                if (item.RouteName.IsNotNullOrEmpty())
                {
                    item.FullActionUrl = _linkBuilder
                                         .BuildFromRoute(item.RouteName, item.RouteValues);
                }
            }
            Items = menuItems;
        }