public IHttpActionResult PutRole(int id, Role role) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != role.Id) { return(BadRequest()); } try { _RDB.Edit(role); } catch (DbUpdateConcurrencyException) { if (!RoleExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }