/// <summary> /// Code puzzles index view load /// </summary> /// <returns></returns> public ActionResult Index() { ViewBag.Title = "Natural language shape generator"; CodePuzzleViewModel model = new CodePuzzleViewModel(); shape = new Shape(); model.Shape = shape; return(View(model)); }
public ActionResult Index(CodePuzzleViewModel model) { try { _IKeyWordProcessor = new KeyWordProcessor(); shape = new Shape(); //Strip the user input string strippedString = _IKeyWordProcessor.StripUserInput(model.ShapeDescription); //Get the shape object shape = _IKeyWordProcessor.IdentifyShape(strippedString); //Assign shape object to view model model.Shape = shape; } catch (Exception ex) { shape = new Shape(); model.Shape = shape; ViewBag.Message = "Error occurred!"; } return(View(model)); }