public IActionResult GetDividedNumber(int id) { ViewBag.NumberOfViews = _counter.UrlCounter[HttpContext.Request.GetDisplayUrl()]; DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id); return(View(divisionResult)); }
public IActionResult GetDividedNumber(int id) { ViewBag.CounterSucceeded = false; DivisionResult divisionResult = _numberCalculator.GetDividedNumbers(id); return(View(divisionResult)); }
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)); }
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)); }