예제 #1
0
        public bool UnFollow(ProfileAggregate otherAggregate)
        {
            if (otherAggregate == default)
            {
                throw new ArgumentException("The user cannot be null");
            }
            if (otherAggregate.Id == Guid.Empty)
            {
                throw new ArgumentException("userid cannot be empty");
            }
            Follower follow = Following.Find(foll => foll.FollowerId == Id && foll.FollowingId == otherAggregate.Id);

            if (follow == default)
            {
                return(false);
            }
            otherAggregate.RemoveFollower(follow);
            Following.Remove(follow);
            return(true);
        }