public async Task<IActionResult> PutTbraking(long id, Tbraking tbraking) { if (id != tbraking.TbrakingId) { return BadRequest(); } _context.Entry(tbraking).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbrakingExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }
public async Task<ActionResult<Tbraking>> PostTbraking(Tbraking tbraking) { _context.Tbraking.Add(tbraking); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TbrakingExists(tbraking.TbrakingId)) { return Conflict(); } else { throw; } } return CreatedAtAction("GetTbraking", new { id = tbraking.TbrakingId }, tbraking); }