Example #1
0
        public static PollInfo GetPollInfo(int siteId, int channelId, int contentId)
        {
            var pollInfoList = PollManagerCache.GetCachePollInfoList(siteId);
            var pollInfo     = pollInfoList.FirstOrDefault(x => x.ChannelId == channelId && x.ContentId == contentId) ??
                               Repository.CreateDefaultPoll(siteId, channelId, contentId);

            return(pollInfo ?? Repository.CreateDefaultPoll(siteId, channelId, contentId));
        }
Example #2
0
        public static List <PollInfo> GetPollInfoList(int siteId, int channelId)
        {
            var pollInfoList = PollManagerCache.GetCachePollInfoList(siteId);

            return(pollInfoList.Where(pollInfo => pollInfo.ChannelId == channelId).OrderBy(pollInfo => pollInfo.Taxis == 0 ? int.MaxValue : pollInfo.Taxis).ToList());
        }
Example #3
0
        public static PollInfo GetPollInfo(int siteId, int pollId)
        {
            var pollInfoList = PollManagerCache.GetCachePollInfoList(siteId);

            return(pollInfoList.FirstOrDefault(x => x.Id == pollId));
        }
Example #4
0
        public static PollInfo GetPollInfo(int siteId, string title)
        {
            var pollInfoList = PollManagerCache.GetCachePollInfoList(siteId);

            return(pollInfoList.FirstOrDefault(x => x.Title == title));
        }