public async Task <IActionResult> PutTlaxDirection(byte id, TlaxDirection tlaxDirection) { if (id != tlaxDirection.TlaxDirectionId) { return(BadRequest()); } _context.Entry(tlaxDirection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TlaxDirectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TlaxDirection> > PostTlaxDirection(TlaxDirection tlaxDirection) { _context.TlaxDirection.Add(tlaxDirection); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TlaxDirectionExists(tlaxDirection.TlaxDirectionId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTlaxDirection", new { id = tlaxDirection.TlaxDirectionId }, tlaxDirection)); }