Exemplo n.º 1
0
        public ActionResult Flyweight(string host)
        {
            WebsiteStatsFactory f = new WebsiteStatsFactory();
            IWebsiteStats       s = f[host];

            return(View());
        }
        public IActionResult ShowStats(string host)
        {
            WebsiteStatsFactory factory = new WebsiteStatsFactory();
            WebsiteStats        stats   = (WebsiteStats)factory[host];

            if (stats == null)
            {
                ViewBag.Message = "Invalid Host Name!";
                return(View("Index"));
            }
            else
            {
                return(View(stats));
            }
        }