public ActionResult AcceptFriend(int id)
        {
            var     friend  = addFriendRepository.Get(id);
            Friends friends = new Friends();

            {
                friends.Friend1 = friend.To;
                friends.Friend2 = friend.From;
            };

            friendRepository.Add(friends);
            friendRepository.Save();
            addFriendRepository.Remove(friend.Id);
            addFriendRepository.Save();

            return(View("Accept"));
        }
Exemple #2
0
        public ActionResult AcceptFriend(int id)
        {
            var     friendRequest = addFriendRepository.Get(id);
            Friends friends       = new Friends();

            {
                friends.Friend1 = friendRequest.To;
                friends.Friend2 = friendRequest.From;
            };

            FriendRepository.Add(friends);
            FriendRepository.Save();
            addFriendRepository.Remove(friendRequest.Id);
            addFriendRepository.Save();

            return(RedirectToAction("Requestlist", "FriendRequest"));
        }