public async Task <IActionResult> GetMessageThread(int carmodelId)
        {
            var messageFromRepo = await _repo.GetMessageThread(carmodelId);

            var messageThread = _mapper.Map <IEnumerable <MessageToReturnDto> >(messageFromRepo);

            return(Ok(messageThread));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetMessageThread(int userId, int recipientId)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            var messageFromRepo = await _repo.GetMessageThread(userId, recipientId);

            var messageThread = _mapper.Map <IEnumerable <MessageToReturnDto> >(messageFromRepo);

            return(Ok(messageThread));
        }