/// <summary> /// Initial Call, will return the view that displays to the user the values of the dice rolls /// </summary> /// <returns></returns> // GET: Dice public ActionResult Index() { Logger.LogMessage("Entering Dice Controller", "Debug"); IDiceRollerBiz dice = new DiceRollerBizComponent.DiceRollerBiz(); //default to 6 sided dice var result = dice.RollTwoDice(6); Logger.LogMessage(string.Format("Passed in total value: {0} to view ", result.totalRollValue), "Debug"); return(View(result)); }
public JsonResult RollDice(int max = 6) { DiceRollerModels.Die dieResults = new DiceRollerModels.Die(); try { Logger.LogMessage("Entering Dice Controller", "Debug"); IDiceRollerBiz dice = new DiceRollerBizComponent.DiceRollerBiz(); dieResults = dice.RollTwoDice(max); Logger.LogMessage(string.Format("Passed in total value: {0} to view ", dieResults.totalRollValue), "Debug"); } catch { } return(Json(dieResults.ToList(), JsonRequestBehavior.AllowGet)); }