public void Follow(Member member) { if (!Followees.Contains(member)) { Followees.Add(member); member.Followers.Add(this); } }
private void Follow(string artistId) { Followees.Add(new Following { FollowerId = Id, FolloweeId = artistId }); }
public bool Follow(ApplicationUser user) { if (Followees.Any(F => F.FolloweeID == user.Id)) { return(false); } Followees.Add(new Following(this, user)); return(true); }
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); }
public FolloweesResult(Followees feeds) : base(feeds) { }
//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); }
private void UnFollow(string artistId) { var following = Followees.First(f => f.FolloweeId == artistId); Followees.Remove(following); }
//It is better to have this in a repository. public bool IsFollowing(string artistId) { return(Followees.Any(f => f.FolloweeId == artistId)); }