public void DeclineCandidate(int id) { using (var context = new CTContext(_conn)) { var candidate = context.Candidates.FirstOrDefault(c => c.Id == id); candidate.Status = 2; context.Candidates.Update(candidate); context.SaveChanges(); } }
public void AddCandidate(Candidate c) { using (var context = new CTContext(_conn)) { var candidate = new Candidate { Name = c.Name, Email = c.Email, Number = c.Number, Notes = c.Notes, Status = 0 }; context.Candidates.Add(candidate); context.SaveChanges(); } }