Пример #1
0
 public void AddCandidate(Candidate c)
 {
     using (var context = new CandidateContext(_connection))
     {
         context.Candidates.Add(c);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void UpdateCandidate(Candidate c)
 {
     using (var context = new CandidateContext(_connection))
     {
         context.Candidates.Attach(c);
         context.Entry(c).State = EntityState.Modified;
         context.SaveChanges();
     }
 }