예제 #1
0
        public void AcceptRequest(int requestId)
        {
            var request = _networkRepository.GetRequestById(requestId);

            var friendConnection = new FriendConnection
            {
                FirstUserId  = request.FromUserId,
                SecondUserId = request.ToUserId
            };


            var areFriends = CheckIfFriends(request.FromUserId, request.ToUserId);

            if (!areFriends)
            {
                _networkRepository.AddFriendConnection(friendConnection);
                _networkRepository.DeleteFriendRequest(request);
            }

            return;
        }