public async Task <ActionResult <TbExpert> > PostTbExpert(TbExpert tbExpert) { _context.TbExpert.Add(tbExpert); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTbExpert", new { id = tbExpert.ExpertId }, tbExpert)); }
public async Task <IActionResult> PutTbExpert(int id, TbExpert tbExpert) { if (id != tbExpert.ExpertId) { return(BadRequest()); } _context.Entry(tbExpert).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbExpertExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }