public async Task <IActionResult> Create(RollVM model) { if (ModelState.IsValid) { Roll roll = model.ToRoll(); _context.Add(roll); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(model)); }
public IActionResult DiceRoller(RollVM rollDie) { rollDie.TotalRoll = rollDie.Die.Roll(rollDie.NumberOfRolls); return(View(rollDie)); }