Пример #1
0
 public void AddCandidate(Candidate c)
 {
     using (var context = new CandidateContext(_connectionString))
     {
         context.Candidates.Add(c);
         context.SaveChanges();
     }
 }
Пример #2
0
        public void Decline(int id)
        {
            using (var context = new CandidateContext(_connectionString))

            {
                Candidate i = context.Candidates.FirstOrDefault(p => p.Id == id);
                i.Confirmed            = false;
                context.Entry(i).State = EntityState.Modified;
                context.SaveChanges();
            }
        }