示例#1
0
 public static RateResponse ToRateResponse(this BoardGameRate entity)
 {
     return(new RateResponse
     {
         Id = entity.Id,
         UserRate = entity.UserRate,
         Comment = entity.Comment,
         UserName = entity?.HexadoUser?.UserName
     });
 }
示例#2
0
        public async Task <Maybe <BoardGame> > RateBoardGame(BoardGameRate rate)
        {
            var boardGame = await _boardGameRepository.GetAsync(rate.BoardGameId);

            if (!boardGame.HasValue)
            {
                return(boardGame);
            }

            boardGame.Value.BoardGameRates.Add(rate);
            return(await _boardGameRepository.UpdateAsync(boardGame.Value));
        }
示例#3
0
 public Task <Maybe <BoardGameRate> > UpdateBoardGameRate(BoardGameRate rate)
 {
     return(_boardGameRateRepository.UpdateAsync(rate));
 }