示例#1
0
        public async Task <IActionResult> Update(ColumnViewModel columnViewModel)
        {
            var isSuccess = await _columnService.UpdateColumnAsync(columnViewModel);

            if (!isSuccess)
            {
                return(this.BadRequestResult("更新失败!"));
            }
            return(Ok());
        }
示例#2
0
        public async Task <IActionResult> Put(int id, [FromBody] Column column)
        {
            if (!(await ColumnService.IsValidRequestBody(column, id)))
            {
                return(BadRequest());
            }
            if (!await ColumnService.IsColumnUnique(column))
            {
                return(Conflict());
            }

            await ColumnService.UpdateColumnAsync(id, column);

            return(NoContent());
        }