public async Task <IActionResult> PutTbaseServiceSection(short id, TbaseServiceSection tbaseServiceSection) { if (id != tbaseServiceSection.TbaseServiceSectionId) { return(BadRequest()); } _context.Entry(tbaseServiceSection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbaseServiceSectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TbaseServiceSection> > PostTbaseServiceSection(TbaseServiceSection tbaseServiceSection) { _context.TbaseServiceSection.Add(tbaseServiceSection); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TbaseServiceSectionExists(tbaseServiceSection.TbaseServiceSectionId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTbaseServiceSection", new { id = tbaseServiceSection.TbaseServiceSectionId }, tbaseServiceSection)); }