Example #1
0
        public async Task <UserMessageBasicInformation> GetMessageById(string messageId)
        {
            try
            {
                var message = await _userMessageRepository.GetMessageById(messageId);

                if (message == null)
                {
                    return(null);
                }
                return(new UserMessageBasicInformation
                {
                    MessageId = message.MessageId,
                    Message = message.Message,
                    Title = message.Title,
                    Time = Utilities.GetFormattedDateFromMillisecond(message.Time),
                    Status = message.Status
                });
            }
            catch (Exception ex)
            {
                throw new Exception("Error getting user messages" + ex);
            }
        }