Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Icon,Name,OrderNo,Type,PickupText,Description,Challenge,Notes")] Item item)
        {
            if (id != item.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(item);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ItemExists(item.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(item));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,OrderNo,Icon,BaseMaxHealth,MaxHealthIncrease,BaseDamage,DamageIncrease,Speed,Challenge,Notes")] Survivor survivor)
        {
            if (id != survivor.ID)
            {
                return(NotFound());
            }

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