public async Task <ActionResult <Fiskmodell> > PostFiskmodell(Fiskmodell fiskmodell) { _context.Fiskar.Add(fiskmodell); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFiskmodell", new { id = fiskmodell.FiskID }, fiskmodell)); }
public async Task <IActionResult> PutFiskmodell(int id, Fiskmodell fiskmodell) { if (id != fiskmodell.FiskID) { return(BadRequest()); } _context.Entry(fiskmodell).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FiskmodellExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }