public void AddCandidate(Candidate c) { using (var context = new CandidateContext(_connection)) { context.Candidates.Add(c); context.SaveChanges(); } }
public void UpdateCandidate(Candidate c) { using (var context = new CandidateContext(_connection)) { context.Candidates.Attach(c); context.Entry(c).State = EntityState.Modified; context.SaveChanges(); } }