public async Task <IActionResult> PutTbalise(short id, Tbalise tbalise) { if (id != tbalise.TbaliseId) { return(BadRequest()); } _context.Entry(tbalise).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbaliseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Tbalise> > PostTbalise(Tbalise tbalise) { _context.Tbalise.Add(tbalise); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TbaliseExists(tbalise.TbaliseId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTbalise", new { id = tbalise.TbaliseId }, tbalise)); }