Exemple #1
0
        public IActionResult Add(OpinionPostDto opinionPostDto)
        {
            _opinionService.AddOpinion(opinionPostDto);
            int w = 7;

            return(Ok());
        }
Exemple #2
0
        public void AddOpinion(OpinionPostDto opinionPostDto)
        {
            Context context = new Context();

            OpinionEntity opinionEntity = _mapper.Map(opinionPostDto, new OpinionEntity());

            if (opinionEntity != null)
            {
                UserEntity userEntity = _userRepository.GetUserByUserId(opinionPostDto.GuidUserId, context);
                userEntity.OpinionEntity.Add(opinionEntity);
                context.SaveChanges();
            }
        }