public async Task <IActionResult> PutTblockPartRef(short id, TblockPartRef tblockPartRef) { if (id != tblockPartRef.TblockPartRefId) { return(BadRequest()); } _context.Entry(tblockPartRef).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblockPartRefExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TblockPartRef> > PostTblockPartRef(TblockPartRef tblockPartRef) { _context.TblockPartRef.Add(tblockPartRef); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TblockPartRefExists(tblockPartRef.TblockPartRefId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTblockPartRef", new { id = tblockPartRef.TblockPartRefId }, tblockPartRef)); }