public async Task <IActionResult> PutEstopDescription(short id, EstopDescription estopDescription) { if (id != estopDescription.EstopDescriptionId) { return(BadRequest()); } _context.Entry(estopDescription).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EstopDescriptionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EstopDescription> > PostEstopDescription(EstopDescription estopDescription) { _context.EstopDescription.Add(estopDescription); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EstopDescriptionExists(estopDescription.EstopDescriptionId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEstopDescription", new { id = estopDescription.EstopDescriptionId }, estopDescription)); }