Ejemplo n.º 1
0
 public void SaveVote(Vote vote)
 {
     using (var db = new ElectionContext())
     {
         db.Votes.Add(vote);
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public List <Vote> GetVotes()
 {
     using (var db = new ElectionContext())
     {
         var result = db.Votes.ToList();
         return(result);
     }
 }
Ejemplo n.º 3
0
 public bool IsThatPeselJustVote(int peselHashCode)
 {
     using (var db = new ElectionContext())
     {
         bool result = db.Votes.Any(x => x.PeselHashCode == peselHashCode);
         return(result);
     }
 }