예제 #1
0
        public void RemovePoll(int pollId)
        {
            var polls = PollTable.Where(x => x.Id == pollId).ToList();

            PollTable.RemoveRange(polls);
            var votes = VoteTable.Where(x => x.Id == pollId).ToList();

            VoteTable.RemoveRange(votes);
            SaveChanges();
        }
예제 #2
0
 public IEnumerable <Poll> GetPollsBy(long userId, long groupId)
 {
     return(PollTable.Where(x => x.UserId == userId && x.GroupId == groupId));
 }
예제 #3
0
 public Poll GetPoll(int pollId)
 {
     return(PollTable.Where(x => x.Id == pollId).FirstOrDefault());
 }