public ActionResult AddCandidate(Candidate candidate) { var manager = new CandidateRepository(Properties.Settings.Default.ConStr); manager.AddCandidate(candidate); return(Redirect("/home/pending")); }
public async Task AddCandidate_ShouldAddOneCandidate() { var options = new DbContextOptionsBuilder <GeekHunterContext>() .UseInMemoryDatabase("AddCandidate_ShouldAddOneCandidate") .Options; var context = new GeekHunterContext(options); await Seed(context); CandidateRepository candidateRepository = new CandidateRepository(context); await candidateRepository.AddCandidate(new AddCandidateDto { FirstName = "TestFirstName", LastName = "TestLastName", Skills = new List <string> { "SQL", "Entity Framework" } }); var candidates = (await candidateRepository.GetCandidates()).ToList(); Assert.Equal(4, candidates.Count); var addedCustomer = candidates[3]; Assert.Equal("TestFirstName", addedCustomer.FirstName); Assert.Equal("TestLastName", addedCustomer.LastName); Assert.Equal(2, addedCustomer.Skills.Count); }
public ActionResult Candidate(Applicant applicant) { var repo = new CandidateRepository(Properties.Settings.Default.ConStr); repo.AddCandidate(applicant); return(Redirect("/home/index")); }
public IActionResult AddCandidate(Candidate candidate) { var manager = new CandidateRepository(_connectionString); manager.AddCandidate(candidate); return(Redirect("/home/pending")); }
public void AddCandidate(Candidate candidate) { var repo = new CandidateRepository(_connectionString); candidate.Status = Status.Pending; repo.AddCandidate(candidate); }
public IActionResult AddCandidate(Candidates candidate) { candidate.Status = Status.Pending; CandidateRepository repo = new CandidateRepository(_connectionString); repo.AddCandidate(candidate); return(Redirect("/home/candidates")); }
public Candidate AddCandidate(Candidate candidate) { using (var candidateRepo = new CandidateRepository()) { candidateRepo.AddCandidate(Mapper.Map <Datacom.CorporateSys.Hire.Domain.Models.Candidate>(candidate)); } return(candidate); }
public ActionResult AddCandidate(string firstName, string lastName, string phoneNumber, string email, string notes) { var db = new CandidateRepository(Properties.Settings.Default.ConStr); db.AddCandidate(new Candidate { FirstName = firstName, LastName = lastName, PhoneNumber = phoneNumber, Email = email, Notes = notes, Status = Status.Pending }); return(Redirect("/Home/Pending")); }
public void AddCandidate(Candidate c) { var repo = new CandidateRepository(_connection); repo.AddCandidate(c); }
public void AddCandidate(Candidate candidate) { var repo = new CandidateRepository(_connectionString); repo.AddCandidate(candidate); }