Пример #1
0
    /// <summary>
    /// Get from database all messages  related of the user  (current user and other users who have conversed with the current user)
    /// </summary>
    /// <param name="userId"></param>
    /// <returns></returns>
    private List <Message> GetListMessagesForUser(int userId)
    {
        var list1 = MessageComponent.GetMessages(UserInfo.UserID, userId).ToList();
        var list2 = MessageComponent.GetMessages(userId, UserInfo.UserID).ToList();
        var listFinallyMessages = list1.Concat(list2).OrderBy(p => p.DateCreated).ToList();

        return(listFinallyMessages);
    }