Example #1
0
        public IActionResult Update(GameShowDTO dto)
        {
            var entity = dto.MapTo <GameShow>();

            _gameShowRepos.Update(entity);
            return(Ok());
        }
Example #2
0
        public GameShowDTO GetGameByKey(string key)
        {
            Game        game   = _unitOfWork.GameRepository.Get(i => i.Key.Equals(key)).FirstOrDefault();
            GameShowDTO result = new GameShowDTO();

            Mapper.Map(game, result);
            return(result);
        }
Example #3
0
        public void AddCommentToGame(GameShowDTO game, CommentDTO comment)
        {
            var commentToAdd = new Comment(); //PH until map comment here
            var targetGame   = new Game();

            Mapper.Map(comment, commentToAdd);
            Mapper.Map(game, targetGame);
            commentToAdd.Game = targetGame;
            _unitOfWork.CommentRepository.Create(commentToAdd);
            _unitOfWork.Commit();
        }