public async Task <IActionResult> PutTloadLimitType(long id, TloadLimitType tloadLimitType) { if (id != tloadLimitType.TloadLimitTypeId) { return(BadRequest()); } _context.Entry(tloadLimitType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TloadLimitTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TloadLimitType> > PostTloadLimitType(TloadLimitType tloadLimitType) { _context.TloadLimitType.Add(tloadLimitType); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TloadLimitTypeExists(tloadLimitType.TloadLimitTypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTloadLimitType", new { id = tloadLimitType.TloadLimitTypeId }, tloadLimitType)); }