public async Task <IActionResult> PutTattribute(long id, Tattribute tattribute) { if (id != tattribute.TattributeId) { return(BadRequest()); } _context.Entry(tattribute).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TattributeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Tattribute> > PostTattribute(Tattribute tattribute) { _context.Tattribute.Add(tattribute); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TattributeExists(tattribute.TattributeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTattribute", new { id = tattribute.TattributeId }, tattribute)); }