public async Task <ActionResult <UmRightsSection> > PostUmRightsSection(UmRightsSection umRightsSection) { _context.UmRightsSections.Add(umRightsSection); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUmRightsSection", new { id = umRightsSection.Id }, umRightsSection)); }
public async Task <IActionResult> PutUmRightsSection(int id, UmRightsSection umRightsSection) { if (id != umRightsSection.Id) { return(BadRequest()); } _context.Entry(umRightsSection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UmRightsSectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }