public void Follow(Member member)
 {
     if (!Followees.Contains(member))
     {
         Followees.Add(member);
         member.Followers.Add(this);
     }
 }
Exemple #2
0
 private void Follow(string artistId)
 {
     Followees.Add(new Following
     {
         FollowerId = Id,
         FolloweeId = artistId
     });
 }
Exemple #3
0
        public bool Follow(ApplicationUser user)
        {
            if (Followees.Any(F => F.FolloweeID == user.Id))
            {
                return(false);
            }

            Followees.Add(new Following(this, user));

            return(true);
        }
Exemple #4
0
        public bool UnFollow(ApplicationUser user)
        {
            int count     = Followees.Count;
            var following = Followees.SingleOrDefault(f => f.FolloweeID == user.Id);

            if (following == null)
            {
                return(false);
            }

            Followees.Remove(following);

            return(true);
        }
        public void Delete()
        {
            //defait les relations de suivi
            foreach (var followee in Followees)
            {
                followee.Followers.Remove(this);
            }
            Followees.Clear();
            foreach (var follower in Followers)
            {
                follower.Followees.Remove(this);
            }
            Followers.Clear();

            //supprime les messages envoyés ou reçus
            Model.Messages.RemoveRange(MessagesSent);
            MessagesSent.Clear();
            Model.Messages.RemoveRange(MessagesReceived);
            MessagesReceived.Clear();

            //supprime le membre lui-meme
            Model.Members.Remove(this);
        }
Exemple #6
0
 public FolloweesResult(Followees feeds)
     : base(feeds)
 {
 }
Exemple #7
0
 //Checks if this user is following another one
 public bool IsFollowing(string anotherUserId)
 {
     return(Followees.Any(f => f.FollowerId == Id && f.FolloweeId == anotherUserId));
 }
 public void Unfollow(Member member)
 {
     Followees.Remove(member);
     member.Followers.Remove(this);
 }
Exemple #9
0
        private void UnFollow(string artistId)
        {
            var following = Followees.First(f => f.FolloweeId == artistId);

            Followees.Remove(following);
        }
Exemple #10
0
 //It is better to have this in a repository.
 public bool IsFollowing(string artistId)
 {
     return(Followees.Any(f => f.FolloweeId == artistId));
 }