Beispiel #1
0
        public IActionResult Calculate(int number)
        {
            var dividers = _dividersService.GetDividers(number);

            return(View("Index", new NumberModel()
            {
                Dividers = new ResponseDividers()
                {
                    AllDividers = dividers.AllDividers, PrimeDividers = dividers.PrimeDividers
                }
            }));
        }
Beispiel #2
0
        public IActionResult GetDividers([FromQuery] int number)
        {
            var responseDividers = _dividersService.GetDividers(number);

            if (responseDividers.FoundAnswer)
            {
                return(Ok(responseDividers));
            }
            else
            {
                return(NoContent());
            }
        }