private async Task<bool> CanVote(Present present, BirthdayPresentEvent birthdayPresentEvent, User userVoted) { if (!this.VotingDataIsValid(present,birthdayPresentEvent, userVoted)) { return false; } if(!birthdayPresentEvent.IsActive) { return false; } if (birthdayPresentEvent.BirthdayGuy.UserName == userVoted.UserName) { return false; } if(await this.UserAlreadyVoted(birthdayPresentEvent, userVoted)) { return false; } return true; }
private bool VotingDataIsValid(Present present, BirthdayPresentEvent birthdayPresentEvent, User userVoted) { if (present == null || birthdayPresentEvent == null || userVoted == null) { return false; } return true; }