public async Task <IActionResult> PutTlocation(long id, Tlocation tlocation) { if (id != tlocation.TlocationId) { return(BadRequest()); } _context.Entry(tlocation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TlocationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Tlocation> > PostTlocation(Tlocation tlocation) { _context.Tlocation.Add(tlocation); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TlocationExists(tlocation.TlocationId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTlocation", new { id = tlocation.TlocationId }, tlocation)); }