示例#1
0
        public async Task <IActionResult> CreateBoard([FromBody] CreateBoardModel board)
        {
            try
            {
                var username = HttpContext.User.Identity.Name;

                if (username == null)
                {
                    return(Unauthorized());
                }

                var id = await _boardService.CreateBoardAsync(board, username);

                return(Ok(id));
            }
            catch (Exception e)
            {
                return(NotFound(e.Message));
            }
        }