public ActionResult Index(int number = 10)
        {
            var viewModel = new FibonacciViewModel
            {
                Results         = _service.GenerateFibonacciSequence(number),
                NumberRequested = number
            };

            return(View(viewModel));
        }
        public ActionResult GenerateFibonacciSequence(FibonacciViewModel model)
        {
            var viewModel = new FibonacciViewModel
            {
                Results         = _service.GenerateFibonacciSequence(model.NumberRequested),
                NumberRequested = model.NumberRequested
            };

            return(View("Index", viewModel));
        }
Beispiel #3
0
        public async Task <ActionResult> Create([Bind] FibonacciViewModel vm)
        {
            var result = await _fibonacciService.GetSequenceAsync(vm.Len);

            return(Ok());
        }