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(); }
public IEnumerable <Poll> GetPollsBy(long userId, long groupId) { return(PollTable.Where(x => x.UserId == userId && x.GroupId == groupId)); }
public Poll GetPoll(int pollId) { return(PollTable.Where(x => x.Id == pollId).FirstOrDefault()); }