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