public IActionResult Index(HexCalculator model) { SetViewBagValues(); if (!ModelState.IsValid) { return(View()); } String selectedValue = model.SelectedOperation; switch (selectedValue) { case "Add": model.ResultInAltBase = model.AdditionResultInHex(); model.ResultInDecimal = model.AdditionResultInDecimal(); break; case "Subtract": model.ResultInAltBase = model.SubtractionResultInHex(); model.ResultInDecimal = model.SubtractionResultInDecimal(); break; case "Multiply": model.ResultInAltBase = model.MultiplicationResultInHex(); model.ResultInDecimal = model.MultiplicationResultInDecimal(); break; case "Divide": model.ResultInAltBase = model.DivisionResultInHex(); model.ResultInDecimal = model.DivisionResultInDecimal(); break; } return(View(model)); }