Exemplo n.º 1
0
        public async Task <ContactsChatMessage> AddMessages(MessageInputModel inputModel)
        {
            var newMessage = new ContactsChatMessage
            {
                SenderId    = inputModel.SenderId,
                ReceiverId  = inputModel.ReceiverId,
                SentOn      = inputModel.SentOn,
                Text        = inputModel.Message,
                HasBeenSeen = false
            };

            await this.context.ContactsChatMessages.AddAsync(newMessage);

            await this.context.SaveChangesAsync();

            return(newMessage);
        }
Exemplo n.º 2
0
 public async Task MarkAsSeenAsync(ContactsChatMessage message)
 {
     message.HasBeenSeen = true;
     await this.context.SaveChangesAsync();
 }