public virtual MasterNode Add(Model model, HyperMediaLink link, MasterNode masterNode, HyperMediaLink nestInThisLink)
            {
                MasterNode curNode = this;

                if (nestInThisLink != null)
                {
                    if (nestInThisLink.InnerLinks == null)
                    {
                        curNode      = nestInThisLink.InnerLinks = masterNode.MemberwiseClone() as MasterNode;
                        curNode.Info = null;
                    }
                    else
                    {
                        curNode = nestInThisLink.InnerLinks;
                    }
                }

                switch (model)
                {
                case Model.Info:
                    if (curNode.Info == null)
                    {
                        curNode.Info = new List <HyperMediaLink>();
                    }
                    curNode.Info.Add(link);
                    break;
                }
                return(curNode);
            }
 private void Add(Model model, HyperMediaLink link, MasterNode masterNode, HyperMediaLink nestInThisLink = null)
 {
     if (Links == null)
     {
         Links = masterNode;
     }
     Links.Add(model, link, masterNode, nestInThisLink);
 }
        protected HyperMediaLink AddModel(Model model, LinkGenerator generator, MasterNode masterNode, HyperMediaLink nestInThisLink = null)
        {
            String href = "hello, world";
            var    link = new HyperMediaLink()
            {
                Href = href == null ? "null" : href,
            };

            Add(model, link, masterNode, nestInThisLink);
            nestInThisLink = link;
            return(nestInThisLink);
        }
        public void AddInfo(LinkGenerator linkGenerator, IUnitOfWork unitOfWork)
        {
            HyperMediaLink nestInThisInfoLink = Add(APIModelExample.Model.Info, linkGenerator, unitOfWork.StartMasterNode);

            Add(APIModelExample.Model.Level1, linkGenerator, unitOfWork.StartMasterNode, nestInThisInfoLink);
        }
 private HyperMediaLink Add(APIModelExample.Model model, LinkGenerator generator, MasterNode masterNode, HyperMediaLink nestInThisLink = null)
 {
     nestInThisLink = AddModel(model, generator, masterNode, nestInThisLink);
     return(nestInThisLink);
 }