Example #1
0
        private Board CreateBoardFromModel(PostBoardModel boardModel, User user)
        {
            var board = Mapper.Map <Board>(boardModel);

            board.CreateDate = DateTime.Now;
            return(board);
        }
Example #2
0
        private async Task UpdateBoardWithUpdateModel(Board board, PostBoardModel updateModel)
        {
            Board sourceBoard = MapPostModelToBoard(updateModel);

            ApplyUpdatedSourceProperties(board, sourceBoard);

            await UpdateBoardAndSave(board);
        }
Example #3
0
 private Board MapPostModelToBoard(PostBoardModel postModel)
 {
     return(Mapper.Map <Board>(postModel));
 }
Example #4
0
 public UpdateBoardCommand(int boardId, PostBoardModel postBoardModel)
 {
     BoardId        = boardId;
     PostBoardModel = postBoardModel;
 }
Example #5
0
 public AddBoardCommand(PostBoardModel postBoardModel)
 {
     PostBoardModel = postBoardModel;
 }
 public async Task <ActionResult <GetBoardModel> > Put(int key, [FromBody] PostBoardModel updateModel)
 {
     return(Ok(await Mediator.Send(new UpdateBoardCommand(key, updateModel))));
 }
 public async Task <ActionResult <GetBoardModel> > PostAsync([FromBody] PostBoardModel postModel)
 {
     return(Ok(await Mediator.Send(new AddBoardCommand(postModel))));
 }