Beispiel #1
0
        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));
        }
Beispiel #2
0
        public async Task <ActionResult <SeekFor> > PostSeekFor(SeekFor seekFor)
        {
            _context.seekFor.Add(seekFor);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSeekFor", new { id = seekFor.Id }, seekFor));
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
        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));
        }