コード例 #1
0
        public async Task <HttpResponseMessage> Update(int id)
        {
            var body = await Request.Content.ReadAsStringAsync();

            var context = new ContextImplement(
                sessionStatus: User?.Identity?.IsAuthenticated == true,
                sessionData: User?.Identity?.IsAuthenticated == true,
                apiRequestBody: body);
            var controller = new Pleasanter.Controllers.Api.UsersController();
            var result     = controller.Update(context: context, id: id);

            return(result.ToHttpResponse(Request));
        }
コード例 #2
0
        public ContentResult Update(int id)
        {
            var body = default(string);

            using (var reader = new StreamReader(Request.Body)) body = reader.ReadToEnd();
            var context = new ContextImplement(
                sessionStatus: User?.Identity?.IsAuthenticated == true,
                sessionData: User?.Identity?.IsAuthenticated == true,
                apiRequestBody: body);
            var controller = new Pleasanter.Controllers.Api.UsersController();
            var result     = controller.Update(context: context, id: id);

            return(result.ToHttpResponse(Request));
        }