public static PollAnswer Create(Guid pollId, string name) { try { var pollAnswer = new Internal.PollAnswer(); pollAnswer.PollId = pollId; pollAnswer.Name = name; Internal.PollingService.AddUpdatePollAnswer(pollAnswer); return(Get(pollAnswer.Id)); } catch (Exception ex) { return(new PollAnswer(new AdditionalInfo(new Error(ex.GetType().FullName, ex.Message)))); } }
public static PollAnswer Create(Guid pollId, string name) { try { var pollAnswer = new Internal.PollAnswer(); pollAnswer.PollId = pollId; pollAnswer.Name = name; Internal.PollingService.AddUpdatePollAnswer(pollAnswer); return Get(pollAnswer.Id); } catch (Exception ex) { return new PollAnswer(new AdditionalInfo(new Error(ex.GetType().FullName, ex.Message))); } }
internal PollAnswer(Internal.PollAnswer pollAnswer, InternalApi.Poll poll) : base() { _pollAnswer = pollAnswer; _hideVoteCounts = poll.HideResultsUntilVotingComplete && poll.VotingEndDateUtc.HasValue && DateTime.UtcNow > poll.VotingEndDateUtc.Value; }