/// <summary>
        /// This method is used to create the list of recommended posts on the user timeline.
        /// </summary>
        /// <param name="currentuser">Logged in user details</param>
        /// <param name="usersPersonalDetails">Users personal details</param>
        /// <param name="usersTradingDetails">Users trading details</param>
        /// <returns>Creates and returns a recommended user list</returns>
        private static List <UsersTimeLinePost> GetUserTimelineRecommendedPosts(LetsTradingDetails currentuser, List <RegisterUserViewModel> usersPersonalDetails, List <LetsTradingDetails> usersTradingDetails)
        {
            var currentUser = currentuser;

            var userList          = new List <LetsUser>();
            var timelinePostsList = new List <UsersTimeLinePost>();

            //Building a list that contains all the users personal details and trading details
            foreach (var userPersonalDetails in usersPersonalDetails)
            {
                var userTradingDetails = usersTradingDetails.Find(item => item.Id.Equals(userPersonalDetails.Id));
                var letsUser           = new LetsUser
                {
                    UserPersonalDetails = userPersonalDetails,
                    UserTradingDetails  = userTradingDetails
                };
                userList.Add(letsUser);
            }

            foreach (var user in userList)
            {
                if (user.UserTradingDetails.Requests != null)
                {
                    foreach (var request in user.UserTradingDetails.Requests)
                    {
                        if (string.IsNullOrEmpty(request.IsAssignedTo) && !request.HasDeleted)
                        {
                            foreach (var tag in request.Tags)
                            {
                                if (currentUser.Skills.Contains(tag))
                                {
                                    var timelinePost = new UsersTimeLinePost
                                    {
                                        ImageId   = user.UserPersonalDetails.Account.ImageId,
                                        UserName  = user.UserPersonalDetails.Account.UserName,
                                        FirstName = user.UserPersonalDetails.About.FirstName,
                                        LastName  = user.UserPersonalDetails.About.LastName,
                                        Request   = request
                                    };

                                    if (!timelinePostsList.Contains(timelinePost))
                                    {
                                        timelinePostsList.Add(timelinePost);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            timelinePostsList = timelinePostsList.OrderBy(post => post.Request.Date).ToList();
            return(timelinePostsList);
        }
        public async Task <ActionResult> ExpandPost(string username, int postId)
        {
            var user = username;

            var userByUsername = await DatabaseContext.RegisteredUsers.Find(new BsonDocument
            {
                { "Account.UserName", user }
            }).ToListAsync();

            var userTradingDetails = await DatabaseContext.LetsTradingDetails.Find(new BsonDocument
            {
                { "_id", userByUsername[0].Id }
            }).ToListAsync();

            var loggedUser = User.Identity.Name;

            var loggedUserByUserName = await DatabaseContext.RegisteredUsers.Find(new BsonDocument
            {
                { "Account.UserName", loggedUser }
            }).ToListAsync();

            var loggedTradingDetails = await DatabaseContext.LetsTradingDetails.Find(new BsonDocument
            {
                { "_id", loggedUserByUserName[0].Id }
            }).ToListAsync();

            var userPost = new UsersTimeLinePost();
            var post     = userTradingDetails[0].Requests.ElementAt(postId);

            userPost.FirstName = userByUsername[0].About.FirstName;
            userPost.LastName  = userByUsername[0].About.LastName;
            userPost.UserName  = userByUsername[0].Account.UserName;
            userPost.Request   = new RequestPost
            {
                Date        = post.Date,
                Budget      = post.Budget,
                Description = post.Description,
                Tags        = post.Tags,
                Title       = post.Title,
                Id          = post.Id,
                Bids        = post.Bids,
                MyCredits   = loggedTradingDetails[0].Credit
            };
            return(View("ExpandedRequest", userPost));
        }