public async Task <IActionResult> PostScienceandtechnologyq([FromBody] Scienceandtechnologyq scienceandtechnologyq) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Scienceandtechnologyq.Add(scienceandtechnologyq); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ScienceandtechnologyqExists(scienceandtechnologyq.Gqid)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetScienceandtechnologyq", new { id = scienceandtechnologyq.Gqid }, scienceandtechnologyq)); }
public async Task <IActionResult> PutScienceandtechnologyq([FromRoute] int id, [FromBody] Scienceandtechnologyq scienceandtechnologyq) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != scienceandtechnologyq.Gqid) { return(BadRequest()); } _context.Entry(scienceandtechnologyq).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ScienceandtechnologyqExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }