예제 #1
0
        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));
        }
예제 #2
0
 public IActionResult DiceRoller(RollVM rollDie)
 {
     rollDie.TotalRoll = rollDie.Die.Roll(rollDie.NumberOfRolls);
     return(View(rollDie));
 }