Esempio n. 1
0
        public async Task <Maybe <BoardGame> > SetImagePath(string id, string imagePath)
        {
            var boardGame = await _boardGameRepository.GetAsync(id);

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

            boardGame.Value.ImagePath = imagePath;
            return(await _boardGameRepository.UpdateAsync(boardGame.Value));
        }
Esempio n. 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));
        }