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() }); }
public async Task <ActionResult <GetUserConversationsResponse> > GetUserConversations([FromQuery] GetUserConversationsRequest request) { return(await _logic.GetUserConversations(request)); }