public async Task <IActionResult> Post([FromBody] BoardData boardData)
        {
            Board board = new Board
            {
                AcctId      = boardData.AcctId,
                DisplayName = boardData.DisplayName,
                Title       = boardData.Title,
                OwnerId     = "",
                TimeStamp   = DateUtils.ConvertToUnixTime(DateTime.UtcNow),
            };

            _dbContext.Add(board);
            await _dbContext.SaveChangesAsync();

            return(Ok(board));
        }
Beispiel #2
0
        public async Task <IActionResult> Post([FromBody] FeedData feedData)
        {
            Feed feed = new Feed
            {
                BoardId     = feedData.BoardId,
                AcctId      = feedData.AcctId,
                DisplayName = feedData.DisplayName,
                Content     = feedData.Content,
                OwnerId     = "",
                TimeStamp   = DateUtils.ConvertToUnixTime(DateTime.UtcNow),
            };

            _dbContext.Add(feed);
            await _dbContext.SaveChangesAsync();

            return(Ok(feed));
        }