Example #1
0
        public ActionResult Index(int nthPrime)
        {
            if (nthPrime < 1)
            {
                ViewBag.Message = MessageHelper.InputIsInvalid;
                return(View("Index"));
            }

            var primeNumber = _primeCalculator.GetNthPrime(nthPrime);

            return(View("Index", primeNumber));
        }