public async Task <IActionResult> PutTgear(long id, Tgear tgear) { if (id != tgear.TgearId) { return(BadRequest()); } _context.Entry(tgear).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TgearExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Tgear> > PostTgear(Tgear tgear) { _context.Tgear.Add(tgear); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TgearExists(tgear.TgearId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTgear", new { id = tgear.TgearId }, tgear)); }