public async Task <IActionResult> PutTdriversCabType(long id, TdriversCabType tdriversCabType) { if (id != tdriversCabType.TdriversCabTypeId) { return(BadRequest()); } _context.Entry(tdriversCabType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TdriversCabTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TdriversCabType> > PostTdriversCabType(TdriversCabType tdriversCabType) { _context.TdriversCabType.Add(tdriversCabType); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TdriversCabTypeExists(tdriversCabType.TdriversCabTypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTdriversCabType", new { id = tdriversCabType.TdriversCabTypeId }, tdriversCabType)); }