コード例 #1
0
        public IActionResult GetDividedNumber(int id)
        {
            ViewBag.NumberOfViews = _counter.UrlCounter[HttpContext.Request.GetDisplayUrl()];
            DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id);

            return(View(divisionResult));
        }
コード例 #2
0
        public IActionResult GetDividedNumber(int id)
        {
            ViewBag.CounterSucceeded = false;
            DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id);

            return(View(divisionResult));
        }
コード例 #3
0
        public IActionResult GetDividedNumber(int id)
        {
            ViewBag.CounterSucceeded = false;

            _counter.IncrementNumberCount(id);
            ViewBag.NumberOfViews    = _counter.NumberCounter[id];
            ViewBag.CounterSucceeded = true;

            DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id);

            return(View(divisionResult));
        }
コード例 #4
0
        public IActionResult GetDividedNumber(int id)
        {
            ViewBag.CounterSucceeded = false;
            try
            {
                _counter.IncrementNumberCount(id);
                ViewBag.NumberOfViews    = _counter.NumberCounter[id];
                ViewBag.CounterSucceeded = true;
                _logger.LogError("GetDividedNumber - Success");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"An error occured while trying to increase or retrieve the page display count. Number parameter is: {id}");
            }
            DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id);

            return(View(divisionResult));
        }