Example #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);
        }
Example #2
0
 private void RemoveFollower(Follower follow)
 {
     Followers.Remove(follow);
 }
Example #3
0
 private void AddFollower(Follower follow)
 {
     Followers.Add(follow);
 }