public async Task <ActionResult <Malfuntions> > PostMalfuntions(Malfuntions malfuntions) { _context.MalfuntionsList.Add(malfuntions); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMalfuntions", new { id = malfuntions.Id }, malfuntions)); }
public async Task <IActionResult> PutMalfuntions(int id, Malfuntions malfuntions) { if (id != malfuntions.Id) { return(BadRequest()); } _context.Entry(malfuntions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MalfuntionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }