Beispiel #1
0
        public OperationResult AcceptFriendRequest(long friendshipId)
        {
            var friendship = friendshipRepository.Get(friendshipId);

            if (friendship == null)
            {
                return(OperationResult.Failed($"FriendRequest with ID = {friendshipId} does not exist"));
            }

            friendship.FriendshipStatus = FriendshipStatus.Accepted;
            friendshipRepository.Save(friendship);

            return(OperationResult.Success());
        }