public async Task <ActionResult <TbSection2> > PostTbSection2(TbSection2 tbSection2) { _context.TbSection2.Add(tbSection2); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTbSection2", new { id = tbSection2.Section2Id }, tbSection2)); }
public async Task <IActionResult> PutTbSection2(int id, TbSection2 tbSection2) { if (id != tbSection2.Section2Id) { return(BadRequest()); } _context.Entry(tbSection2).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbSection2Exists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }