public async Task <IActionResult> PutMapUserRoleRights([FromRoute] int id, [FromBody] MapUserRoleRights mapUserRoleRights) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapUserRoleRights.RightsId) { return(BadRequest()); } _context.Entry(mapUserRoleRights).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapUserRoleRightsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapUserRoleRights([FromBody] MapUserRoleRights mapUserRoleRights) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapUserRoleRights.Add(mapUserRoleRights); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapUserRoleRights", new { id = mapUserRoleRights.RightsId }, mapUserRoleRights)); }