public async Task <ActionResult <Vask> > PostVask(Vask vask) { _context.vaskeTabell.Add(vask); await _context.SaveChangesAsync(); return(vask); //return CreatedAtAction(nameof(GetVask), new { id = vask.vaskID }, vask); }
public async Task <ActionResult <Vask> > UpdateVask(int id, [FromBody] Vask vask) { var exists = await _context.vaskeTabell.AnyAsync(v => v.vaskID == id); if (!exists) { Console.Beep(); return(NotFound()); } _context.vaskeTabell.Update(vask); await _context.SaveChangesAsync(); return(Ok()); }