StorytellerDocGen.Topics.Topic.Ancestors C# (CSharp) Method

Ancestors() public method

public Ancestors ( ) : IEnumerable
return IEnumerable
        public IEnumerable<Topic> Ancestors()
        {
            return anscestors().Reverse().ToArray();
        }

Usage Example

コード例 #1
0
        public string Transform(Topic current, string data)
        {
            var ol = new HtmlTag("ol").AddClass("breadcrumb");

            current.Ancestors().Each(x =>
            {
                ol.Add("li/a").Attr("href", _resolver.ToUrl(current, x)).Text(x.Title);
            });

            ol.Add("li").AddClass("active").Text(current.Title);

            return ol.ToString();
        }