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