예제 #1
0
        public ActionResult <MessageDto> CreateMessage(MessageForCreationDto message)
        {
            var messageEntity = _mapper.Map <Entities.Message>(message);

            _messageBoardRepository.AddMessage(messageEntity);
            _messageBoardRepository.Save();

            var messageToReturn = _mapper.Map <MessageDto>(messageEntity);

            return(CreatedAtRoute("GetMessage", new { messageId = messageToReturn.Id }, messageToReturn));
        }