public async Task <IActionResult> Edit(int id, [Bind("Id,Word")] SeekFor seekFor) { if (id != seekFor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(seekFor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SeekForExists(seekFor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(seekFor)); }
public async Task <ActionResult <SeekFor> > PostSeekFor(SeekFor seekFor) { _context.seekFor.Add(seekFor); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSeekFor", new { id = seekFor.Id }, seekFor)); }
public async Task <IActionResult> PutSeekFor(int id, SeekFor seekFor) { if (id != seekFor.Id) { return(BadRequest()); } _context.Entry(seekFor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SeekForExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("Id,Word")] SeekFor seekFor) { if (ModelState.IsValid) { _context.Add(seekFor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(seekFor)); }