Example #1
0
        public async Task <ActionResult <Column> > Post([FromBody] Column column)
        {
            if (!(await ColumnService.IsValidRequestBody(column)))
            {
                return(BadRequest());
            }
            if (!await ColumnService.IsColumnUnique(column))
            {
                return(Conflict());
            }

            var createdColumn = await ColumnService.InsertColumnAsync(column);

            return(CreatedAtAction(
                       nameof(GetSingleColumn),
                       new { id = createdColumn.Id },
                       createdColumn));
        }