private Board CreateBoardFromModel(PostBoardModel boardModel, User user) { var board = Mapper.Map <Board>(boardModel); board.CreateDate = DateTime.Now; return(board); }
private async Task UpdateBoardWithUpdateModel(Board board, PostBoardModel updateModel) { Board sourceBoard = MapPostModelToBoard(updateModel); ApplyUpdatedSourceProperties(board, sourceBoard); await UpdateBoardAndSave(board); }
private Board MapPostModelToBoard(PostBoardModel postModel) { return(Mapper.Map <Board>(postModel)); }
public UpdateBoardCommand(int boardId, PostBoardModel postBoardModel) { BoardId = boardId; PostBoardModel = postBoardModel; }
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)))); }