public void RemoveVote(int user) { var vote = Votes.SingleOrDefault(v => v.User.UserId == user); Votes.Remove(vote); setScore(); }
public void AddVote(OptionVote optionVote) { //Dos votos son iguales si un usario ya ha votado if (!Votes.Contains(optionVote)) { Votes.Add(optionVote); } else { Votes.Remove(optionVote); Votes.Add(optionVote); } }
public override TagVote RemoveVote(User user) { var vote = FindVote(user); if (vote == null) { return(null); } Votes.Remove(vote); Count--; return(vote); }
public bool AddVote(User user, VoteType type) { var foundVote = Votes.Find(v => v.UserId == user.Id); if (foundVote != null) { if (foundVote.Type != type) { Votes.Remove(foundVote); } else { return(false); } } Votes.Add(new Vote(user, type)); return(true); }
public void RemoveVote(string participantId) { Votes.Remove(Votes.FirstOrDefault(x => x.GivenBy == participantId)); }