コード例 #1
0
        public ActionResult Contact()
        // I lost track of what this code does.
        {
            TagCatsRepoDapper             repo    = new TagCatsRepoDapper();
            IEnumerable <TagCatsTableRow> allCats = repo.GetAll();

            List <OutlineVM1> TagIds = new List <OutlineVM1>();
            int    tagId, parentId;
            string tagName;

            foreach (TagCatsTableRow oneTag in allCats)
            {
                //tagId = oneTag.TagNameId;
                //parentId = (int)oneTag.TagParentId;
                //tagName = oneTag.TagName;

                OutlineVM1 nextTagInfo = new OutlineVM1();
                nextTagInfo.TagId.Add(oneTag.TagNameId);
                nextTagInfo.ParentId.Add((int)oneTag.TagParentId);

                TagIds.Add(nextTagInfo);
            }

            //Finished the foreach above before stopping. Next, send this model to the html page
            //and try to use the parentId as the list index of tag Id to try and make an outline.

            return(View());
        }
コード例 #2
0
        public void CanLoadAllTags()
        {
            TagCatsRepoDapper             repo    = new TagCatsRepoDapper();
            IEnumerable <TagCatsTableRow> allCats = repo.GetAll();

            Assert.AreEqual(16, allCats.Count());
        }
コード例 #3
0
        public ActionResult About()
        {
            List <TagCatsTableRow> allCats = _repo.GetAll().ToList();

            return(View(allCats));
        }