コード例 #1
0
        public ActionResult Tags(FormCollection formy)
        {
            var tagname = formy["TagSelect"];

            IEnumerable<dynamic> taglist;
            dynamic taggy;

            var profiler = MiniProfiler.Current;
            using (profiler.Step("get tag dropdown"))
            {
                //taglist = taglist = itagRepository.GetTagList(); itagRepository.GetPostsByTag(tagname);
                taglist = itagRepository.GetTagList();
            }

            using (profiler.Step("get Tag Count"))
            {

                taggy = itagRepository.GetTagCount(tagname);

                //uncomment for the Dapper version
                //taggy = itagRepository.GetdynPostsByTag(tagname);
            }

                var viewModel = new TagSearchViewModel
                {
                    TagList = taglist,
                    TagCount = taggy
                };

                return View(viewModel);
        }
コード例 #2
0
        public ActionResult Tags()
        {
            IEnumerable<dynamic> taglist;

            var profiler = MiniProfiler.Current;
            using (profiler.Step("get tag dropdown"))
            {
                taglist = itagRepository.GetTagList();
            }

            using (profiler.Step("get Tag Count"))
            { }
                var viewModel = new TagSearchViewModel
                {
                    TagList = taglist,
                    TagCount = null
                };
              return View(viewModel);
        }