public async Task <ActionResult <Doloto> > PostDoloto(Doloto doloto) { _context.Dolotoes.Add(doloto); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetDoloto), new { id = doloto.Id }, doloto)); }
public async Task <IActionResult> PutDoloto(int id, Doloto doloto) { if (id != doloto.Id) { return(BadRequest()); } _context.Entry(doloto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DolotoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }