示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Naam,Wachtwoord,Token,Kleur")] Spel speler)
        {
            if (id != speler.ID)
            {
                return(NotFound());
            }



            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(speler);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SpelerExists(speler.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(speler));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Omschrijving,Token,JsonBord,AandeBeurt")] Spel spel)
        {
            if (id != spel.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(spel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SpelExists(spel.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(spel));
        }