public async Task <ChatMessage> GetMessageByIDAsync(Guid chatMessageID)
        {
            ChatMessage logicMessage = await santaContext.ChatMessages
                                       .Select(message => new ChatMessage()
            {
                chatMessageID        = message.ChatMessageId,
                clientRelationXrefID = message.ClientRelationXrefId != null ? message.ClientRelationXrefId : null,
                recieverClient       = new ClientChatMeta()
                {
                    clientId       = message.MessageReceiverClientId != null ? message.MessageReceiverClientId : null,
                    clientNickname = message.MessageReceiverClientId != null ? message.MessageReceiverClient.Nickname : String.Empty
                },
                senderClient = new ClientChatMeta()
                {
                    clientId       = message.MessageSenderClientId != null ? message.MessageSenderClientId : null,
                    clientNickname = message.MessageSenderClientId != null ? message.MessageSenderClient.Nickname : String.Empty
                },
                messageContent = message.MessageContent,
                dateTimeSent   = message.DateTimeSent,
                isMessageRead  = message.IsMessageRead,
                fromAdmin      = message.FromAdmin
            }).FirstOrDefaultAsync(m => m.chatMessageID == chatMessageID);

            return(logicMessage);
        }
        public async Task UpdateMessageByIDAsync(ChatMessage targetMessage)
        {
            Message.Data.Entities.ChatMessage contextMessage = await santaContext.ChatMessages.FirstOrDefaultAsync(m => m.ChatMessageId == targetMessage.chatMessageID);

            contextMessage.IsMessageRead = targetMessage.isMessageRead;

            santaContext.ChatMessages.Update(contextMessage);
        }
 public async Task CreateMessage(ChatMessage newMessage)
 {
     Message.Data.Entities.ChatMessage contextMessage = Mapper.MapMessage(newMessage);
     await santaContext.ChatMessages.AddAsync(contextMessage);
 }