public async Task <ActionResult <TblDirection> > PostTblDirection(TblDirection tblDirection) { _context.TblDirection.Add(tblDirection); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTblDirection", new { id = tblDirection.IdDirection }, tblDirection)); }
public async Task <IActionResult> PutTblDirection(int id, TblDirection tblDirection) { if (id != tblDirection.IdDirection) { return(BadRequest()); } _context.Entry(tblDirection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblDirectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }