Exemple #1
0
 public async Task <GetUserConversationsResponse> GetUserConversations(GetUserConversationsRequest request)
 {
     return(new GetUserConversationsResponse
     {
         Conversations = (await _repository.GetListAsync <AdmMessagesDetail>(msg =>
                                                                             msg.AdmMessageID == request.MessageId))
                         .OrderByDescending(msg => msg.MessageDate)
                         .Select(m => new ConversationModel
         {
             AdmMessagesDetailID = m.AdmMessagesDetailID,
             AdmMessageID = m.AdmMessageID,
             UserName = m.AdmUser.FirstName + " " + m.AdmUser.LastName,
             MesageText = m.MesageText,
             IsRead = m.SentByAdmUserID == request.AdmUserId || m.IsRead,
             IsForwarded = m.IsForwarded,
             MessageDate = m.MessageDate
         })
                         .ToList()
     });
 }
Exemple #2
0
 public async Task <ActionResult <GetUserConversationsResponse> > GetUserConversations([FromQuery] GetUserConversationsRequest request)
 {
     return(await _logic.GetUserConversations(request));
 }