Esempio n. 1
0
        // POST api/users/5/roles
        public async Task<HttpResponseMessage> Post(string id, PortalRoleModel role)
        {
            // Add user role
            await _userService.AddRoleAsync(id, role.Name);

            return Request.CreateResponse(HttpStatusCode.Created, (PortalRole)role);
        }
Esempio n. 2
0
        // DELETE api/users/5/roles
        public async Task<HttpResponseMessage> Delete(string id, PortalRoleModel role)
        {
            await _userService.DeleteRoleAsync(id, role.Name);

            return Request.CreateResponse(HttpStatusCode.OK);
        }