コード例 #1
0
        public IViewComponentResult Invoke(int categoryId)
        {
            CategoryView category = eCommerce.GetCategoryBy(categoryId);
            var          crumbs   = new LinkedList <HtmlLinkAttributes>();

            while (category != null)
            {
                crumbs.AddFirst(new HtmlLinkAttributes(category.Name, Url.Action("Search", "ProductType", new { categoryId = category.Id })));
                category = eCommerce.GetParentCategory(int.Parse(category.Id));
            }
            return(View(crumbs));
        }