public ActionResult Index() { ShapeViewModel shapeViewModel = new ShapeViewModel() { Shape = Last() }; return View(shapeViewModel); }
public ActionResult Save(ShapeViewModel viewModel) { ShapeModel shape = viewModel.Shape; if (ModelState.IsValid) { ShapeModel newShape = new ShapeModel { ShapeTypeId = shape.ShapeTypeId, Height = shape.Height, Label = shape.Label, LabelRow = shape.LabelRow }; Save(shape); } return View("Index", viewModel); }