Ejemplo n.º 1
0
        public async Task<HttpResponseMessage> Post(ScimGroup1 groupDto)
        {
            return (await _GroupService.CreateGroup(groupDto))
                .Let(group => SetMetaLocation(group, RetrieveGroupRouteName, new { groupId = group.Id }))
                .ToHttpResponseMessage(Request, (group, response) =>
                {
                    response.StatusCode = HttpStatusCode.Created;

                    SetContentLocationHeader(response, RetrieveGroupRouteName, new { groupId = group.Id });
                    SetETagHeader(response, group);
                });
        }
Ejemplo n.º 2
0
        public async Task <HttpResponseMessage> Post(ScimGroup1 groupDto)
        {
            return((await _GroupService.CreateGroup(groupDto))
                   .Let(group => SetMetaLocation(group, RetrieveGroupRouteName, new { groupId = group.Id }))
                   .ToHttpResponseMessage(Request, (group, response) =>
            {
                response.StatusCode = HttpStatusCode.Created;

                SetContentLocationHeader(response, RetrieveGroupRouteName, new { groupId = group.Id });
                SetETagHeader(response, group);
            }));
        }
Ejemplo n.º 3
0
        public async Task <HttpResponseMessage> Put(string groupId, ScimGroup1 groupDto)
        {
            groupDto.Id = groupId;

            return((await _GroupService.UpdateGroup(groupDto))
                   .Let(group => SetMetaLocation(group, RetrieveGroupRouteName, new { groupId = group.Id }))
                   .ToHttpResponseMessage(Request, (group, response) =>
            {
                SetContentLocationHeader(response, RetrieveGroupRouteName, new { groupId = group.Id });
                SetETagHeader(response, group);
            }));
        }
Ejemplo n.º 4
0
        public async Task<HttpResponseMessage> Put(string groupId, ScimGroup1 groupDto)
        {
            groupDto.Id = groupId;

            return (await _GroupService.UpdateGroup(groupDto))
                .Let(group => SetMetaLocation(group, RetrieveGroupRouteName, new { groupId = group.Id }))
                .ToHttpResponseMessage(Request, (group, response) =>
                {
                    SetContentLocationHeader(response, RetrieveGroupRouteName, new { groupId = group.Id });
                    SetETagHeader(response, group);
                });
        }