public async Task <IActionResult> Post([FromBody] ScimGroup model) { var group = model.ToGroup(_orgId); await _groupService.SaveAsync(group); var result = new ScimGroup(group); var getUrl = Url.Action("Get", "Groups", new { id = group.Id.ToString() }, Request.Protocol, Request.Host.Value); return(new CreatedResult(getUrl, result)); }
public async Task <IActionResult> Put(string id, [FromBody] ScimGroup model) { var group = await _groupRepository.GetByIdAsync(new Guid(id)); if (group == null || group.OrganizationId != _orgId) { throw new NotFoundException(); } group = model.ToGroup(group); await _groupService.SaveAsync(group); var result = new ScimGroup(group); return(new OkObjectResult(result)); }