public DualChatRoomViewModel Map(User sender, User receiver)
        {
            var result = new DualChatRoomViewModel();

            result.SenderFirstName = sender.UserProfile.FirstName;
            result.SenderLastName = sender.UserProfile.LastName;
            result.SenderUserKey = sender.Key;

            result.ReceiverFirstName = receiver.UserProfile.FirstName;
            result.ReceiverLastName = receiver.UserProfile.LastName;
            result.ReceiverUserKey = receiver.Key;

            return result;
        }
        public PartialViewResult DualChatRoom(int? friendKey)
        {
            var userIdentity = this.User.Identity as CustomIdentity;
            var chatViewModel = new DualChatRoomViewModel();

            if (friendKey.HasValue)
            {
                User currentUser = this._membershipService.GetUserByKey(userIdentity.Id);
                User friend = this._membershipService.GetUserByKey(friendKey.GetValueOrDefault());
                IEnumerable<Message> messages = this._messageService.GetDayChatMessages(
                    currentUser,
                    friend);
                chatViewModel = this._chatMapper.Map(currentUser, friend);
                chatViewModel.Messages =
                    messages.Select(p => this._chatMapper.MapMessage(p)).ToList();
            }

            return this.PartialView("_DualChatRoom", chatViewModel);
        }