public void Vote(User user) { User temp = _repository.Users.Find((u) => u.Name == user.Name); if (temp != null) { temp.IsAttending = user.IsAttending; _repository.Save(); } else { _repository.AddUser(user); } }
public void Vote(Participant participant) { if (participant.Name != string.Empty) { Participant temp = _participantsRepository.Participants.Find((p) => p.Name == participant.Name); if (temp != null) { temp.IsAttending = participant.IsAttending; temp.PartyId = participant.PartyId; if (participant.Avatar != null) { temp.Avatar = participant.Avatar; } _participantsRepository.Save(); } else { _participantsRepository.AddUser(participant); } } }