public async Task <IActionResult> PutTitlebasics(string id, Titlebasics titlebasics) { if (id != titlebasics.Tconst) { return(BadRequest()); } _context.Entry(titlebasics).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TitlebasicsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Titlebasics> > PostTitlebasics(Titlebasics titlebasics) { _context.Titlebasics.Add(titlebasics); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TitlebasicsExists(titlebasics.Tconst)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTitlebasics", new { id = titlebasics.Tconst }, titlebasics)); }