Ejemplo n.º 1
0
        public IActionResult Show(string?command)
        {
            var modelData = _modelService.GetAll();

            if (command == "Addition")
            {
                modelData = _modelService.GetAll().Where(x => x.Operation == "Addition").ToList();
            }
            if (command == "Substract")
            {
                modelData = _modelService.GetAll().Where(x => x.Operation == "Substract").ToList();
            }
            if (command == "Multiply")
            {
                modelData = _modelService.GetAll().Where(x => x.Operation == "Multiply").ToList();
            }
            if (command == "Divide")
            {
                modelData = _modelService.GetAll().Where(x => x.Operation == "Divide").ToList();
            }
            if (command == "Modulo")
            {
                modelData = _modelService.GetAll().Where(x => x.Operation == "Modulo").ToList();
            }
            if (command == "All")
            {
                modelData = _modelService.GetAll();
            }


            return(View(modelData));
        }