Ejemplo n.º 1
0
        public IActionResult Index(ShapeGeneratorModel model)
        {
            if (ModelState.IsValid)
            {
                var shape = shapeGenerator.ParseCommand(model.Command);
                if (shape != null)
                {
                    model.Shape = shape;
                }
                else
                {
                    ModelState.AddModelError("", "Failed to understand your command");
                }
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult Index()
        {
            var model = new ShapeGeneratorModel();

            return(View(model));
        }