public async Task <ActionResult <dotation> > Postdotation(dotation dotation) { _context.dotations.Add(dotation); await _context.SaveChangesAsync(); return(CreatedAtAction("Getdotation", new { id = dotation.Id }, dotation)); }
public async Task <IActionResult> Putdotation(int id, dotation dotation) { if (id != dotation.Id) { return(BadRequest()); } _context.Entry(dotation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!dotationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }