Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Etkigrubu")] Etki etki)
        {
            if (id != etki.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(etki);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EtkiExists(etki.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(etki));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Etkigrubu")] Etki etki)
        {
            if (ModelState.IsValid)
            {
                _context.Add(etki);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(etki));
        }