Пример #1
0
        private static Party GetPartyByCandidate(int candidateId)
        {
            gerrymanderEntities db = new gerrymanderEntities();
            var candidate          = db.Candidates.First(c => c.Id == candidateId);
            var party = db.Parties.First(p => p.Id == candidate.Party);

            return(party);
        }
Пример #2
0
        private static List <VotingSite> GetVotingSitesByVotingDistrict(int votingDistrictId)
        {
            gerrymanderEntities db = new gerrymanderEntities();

            return(db.VotingSites.Where(s => s.VotingDistrict == votingDistrictId).ToList());
        }
Пример #3
0
        private static List <VotingDistrict> GetVotingDistricts()
        {
            gerrymanderEntities db = new gerrymanderEntities();

            return(db.VotingDistricts.ToList());
        }
Пример #4
0
        private static List <Candidate> GetCandidatesByVotingDistrict(int votingDistrictId)
        {
            gerrymanderEntities db = new gerrymanderEntities();

            return(db.Candidates.Where(d => d.VotingDistrict == votingDistrictId).ToList());
        }